From 12e3cc9d62c8ed251a47b07c270795ad7e07da1a Mon Sep 17 00:00:00 2001 From: Mark Hoeber Date: Thu, 26 Feb 2015 13:14:40 -0500 Subject: [PATCH] Update IFrame, Zooming Image, and Full Screen Image Templates --- .../contentstore/features/component.feature | 4 +- .../contentstore/features/component.py | 2 +- .../xmodule/templates/html/iframe.yaml | 36 ++++++++++++---- .../xmodule/templates/html/image_modal.yaml | 25 +++++++++-- .../xmodule/templates/html/zooming_image.yaml | 42 ++++++++++++++++--- 5 files changed, 88 insertions(+), 21 deletions(-) diff --git a/cms/djangoapps/contentstore/features/component.feature b/cms/djangoapps/contentstore/features/component.feature index 482a070716..29b8db2400 100644 --- a/cms/djangoapps/contentstore/features/component.feature +++ b/cms/djangoapps/contentstore/features/component.feature @@ -19,13 +19,13 @@ Feature: CMS.Component Adding | Component | | Text | | Announcement | - | Zooming Image | + | Zooming Image Tool | | Raw HTML | Then I see HTML components in this order: | Component | | Text | | Announcement | - | Zooming Image | + | Zooming Image Tool | | Raw HTML | Scenario: I can add Latex HTML components diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index 24223cbb42..820af47d59 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -56,7 +56,7 @@ def see_a_multi_step_component(step, category): html_matcher = { 'Text': '\n \n', 'Announcement': '

Words of encouragement! This is a short note that most students will read.

', - 'Zooming Image': '

ZOOMING DIAGRAMS

', + 'Zooming Image Tool': '

Zooming Image Tool

', 'E-text Written in LaTeX': '

Example: E-text page

', 'Raw HTML': '

This template is similar to the Text template. The only difference is', } diff --git a/common/lib/xmodule/xmodule/templates/html/iframe.yaml b/common/lib/xmodule/xmodule/templates/html/iframe.yaml index 0bb3c684b1..c21c8c7096 100644 --- a/common/lib/xmodule/xmodule/templates/html/iframe.yaml +++ b/common/lib/xmodule/xmodule/templates/html/iframe.yaml @@ -1,14 +1,32 @@ --- metadata: - display_name: IFrame + display_name: IFrame Tool data: | -

IFrame

-

An IFrame allows you to integrate ungraded exercises and tools from any Internet site into the body of your course. The IFrame appears inside an HTML component, and the exercise or tool appears inside the IFrame.

-

IFrames are well-suited for third-party tools that demonstrate a concept but that won't be graded or store student data. For example, the tool in this template allows students to experiment with the way the shape of a triangle affects a particular line that is derived from the triangle.

-

To add the exercise or tool in an IFrame, replace the URL in the example tool below with the URL of the page that contains the exercise or tool that you want. Note that the URL must start with https instead of http so that the IFrame will appear in all browsers.

-

For more information about IFrames and their attributes, see the IFrame specification.

-

In the image below, drag any of the red points to a new location. As you drag the point, notice the way the point's position affects the triangle's Euler line.

+

IFrame Tool

+

Use the IFrame tool to embed an exercise or tool from any web site into your course content. For example, the tool below allows learners to experiment with how the shape of a triangle affects a line that is derived from the triangle.

+

Exercises in an IFrame are not graded. To embed graded exercises, use a Custom JavaScript Problem.

+

The following code is the HTML format required to use the IFrame tool. For the IFrame in this template, you must replace the values in italics.

+
+        <iframe title="The required title of the tool" 
+          src="The URL of the tool, starting with https://">
+           Message displayed when the browser does not support IFrames.
+        </iframe>
+        
+

The Iframe below includes the width, height, marginwidth, marginheight, frameborder, and scrolling attributes. These attributes are optional. You can remove these attributes or replace their values.

+

Modify this template as needed.

+

To modify the IFrame, you must edit the HTML source code. When editing this template, click HTML in the toolbar.

+

Then modify the example below for your own use. +

    +
  1. Replace the value of the src attribute of the IFrame with the URL of the tool that you want in your course. +

    Note: The URL must start with https instead of http, to ensure that the tool appears in all browsers that support IFrames.

  2. +
  3. Replace the value of the title attribute with the title of the tool. You must include the title to provide an accessible label.
  4. +
  5. Replace other IFrame attributes as needed. See the IFrame specification for more information.
  6. +
  7. Optionally, replace the text between the opening and closing iframe tags. +
    Your browser does not support IFrames.
    +

    A learner sees this text if the browser does not support IFrames.

    +
  8. +
+

The sample IFrame follows. Modify its attributes as described above.

- diff --git a/common/lib/xmodule/xmodule/templates/html/image_modal.yaml b/common/lib/xmodule/xmodule/templates/html/image_modal.yaml index a9cd941aa8..3df8b22a73 100644 --- a/common/lib/xmodule/xmodule/templates/html/image_modal.yaml +++ b/common/lib/xmodule/xmodule/templates/html/image_modal.yaml @@ -1,7 +1,24 @@ --- metadata: - display_name: Full Screen Image + display_name: Full Screen Image Tool data: | -

Full Screen Image

-

Use the full screen image tool to allow students to open the image in the full screen, zoom in on the image, and drag the image within the screen.

- The Stanford Hills \ No newline at end of file +

Full Screen Image Tool

+

Use the Full Screen Image tool to allow learners to open and zoom in on a larger version of an image in your course.

+

With the Full Screen Image tool, learners can see the image's details as well as its context within the unit.

+

To enable users to view the larger image, you wrap the smaller image in a link to the larger version of the image.

+

The following HTML code shows the format required to use the Full Screen Image tool. For the example in this template, you must replace the values in italics.

+
+        <a href="Path to full screen image" class="modal-content">
+          <img alt="Text for screen readers" 
+          src="Path to image to include in unit page"/>
+        </a>
+        
+

You can modify the example below for your own use.

+
    +
  1. Replace the value of the link's href attribute with the path to the full size image. Do not change the value of the class attribute.
  2. +
  3. Replace the value of the image's src attribute with the path to the image that will appear in the unit before a learner opens it in full screen mode.
  4. +
  5. Replace the value of the image's alt attribute with text that both describes the image and the action or destination of clicking on the image. You must include alt text to provide an accessible label.
  6. +
+

Note: Test viewing the image in full screen mode in the LMS; you cannot view it in full screen from within Studio.

+ + An image of the Stanford Hills. Select the image to open it in full screen mode. \ No newline at end of file diff --git a/common/lib/xmodule/xmodule/templates/html/zooming_image.yaml b/common/lib/xmodule/xmodule/templates/html/zooming_image.yaml index 3ac9d63bcb..8540760a03 100644 --- a/common/lib/xmodule/xmodule/templates/html/zooming_image.yaml +++ b/common/lib/xmodule/xmodule/templates/html/zooming_image.yaml @@ -1,12 +1,44 @@ --- metadata: - display_name: Zooming Image + display_name: Zooming Image Tool data: | -

ZOOMING DIAGRAMS

-

Some edX classes use extremely large, extremely detailed graphics. To make it easier to understand we can offer two versions of those graphics, with the zoomed section showing when you click on the main view.

-

The example below is from 7.00x: Introduction to Biology and shows a subset of the biochemical reactions that cells carry out.

+

Zooming Image Tool

+

Use the Zooming Image Tool to enable learners to see details of large, complex images.

+

With the Zooming Image Tool, the learner can move the mouse pointer over a part of the image to enlarge it and see more detail.

+

To use the Zooming Image Tool, you must first add the jquery.loupeAndLightbox.js JavaScript file to your course.

+

You must also add both the regular and magnified image files to your course.

+

The following HTML code shows the format required to use the Zooming Image tool. For the example in this template, you must replace the values in italics.

+
+        <div class="zooming-image-place" style="position: relative;">
+          <a class="loupe" href="path to the magnified version of the image">
+            <img alt="Text for screen readers" 
+              src="path to the image you want to display in the unit" />
+          </a>
+          <div class="script_placeholder" 
+            data-src="path to the jquery.loupeAndLightbox.js JavaScript file in your course"/>
+        </div>
+        <script type="text/javascript">// >![CDATA[
+        JavascriptLoader.executeModuleScripts($('.zooming-image-place').eq(0), function() {
+          $('.loupe').loupeAndLightbox({
+            width: 350,
+            height: 350,
+            lightbox: false
+          });
+        });
+        // ]]></script>
+        <div id="ap_listener_added"></div>
+        
+ +

You can modify the example below for your own use.

+
    +
  1. Replace the value of the link's href attribute with the path to the magnified image. Do not change the value of the class attribute.
  2. +
  3. Replace the value of the image's src attribute with the path to the image that will appear in the unit.
  4. +
  5. Replace the value of the image's alt attribute with text that both describes the image and the action or destination of clicking on the image. You must include alt text to provide an accessible label.
  6. +
  7. Replace the value of the div element's data-src attribute with the path to the jquery.loupeAndLightbox.js JavaScript file in your course.
  8. +
+

The example below shows a subset of the biochemical reactions that cells carry out.

You can view the chemical structures of the molecules by clicking on them. The magnified view also lists the enzymes involved in each step.

-

Press spacebar to open the magifier.

+

Press spacebar to open the magnifier.

magnify