Difference between revisions of "CMS Using Jmol"

From Jmol
Jump to navigation Jump to search
(Moodle)
(Moodle)
Line 11: Line 11:
 
Molecular model files may be displayed in Moodle pages using a ''filter'', a ''resource'', or placed in searchable databases that students can edit.
 
Molecular model files may be displayed in Moodle pages using a ''filter'', a ''resource'', or placed in searchable databases that students can edit.
  
Compatibility with recent Moodle versions is uncertain; if you have installed this filter or resource in your Moodle, please contact us<ref name="DevList">Send an email to mol-developers AT lists.sourceforge.net</ref> with information that might be added here.  
+
Compatibility with recent Moodle versions is uncertain; if you have installed this filter or resource in your Moodle, please contact us<ref name="DevList">Send an email to mol-developers AT lists DOT sourceforge DOT net</ref> with information that might be added here.  
  
 
=== The Jmol filter for Moodle ===
 
=== The Jmol filter for Moodle ===
A third-party '''Jmol filter''' ([https://docs.moodle.org/36/en/Jmol_filter information]) detects links to molecular model files (.mol, .csmol, .pdb, .xyz, .cml) in Moodle documents and converts them into embedded Jmol models.  
+
A third-party '''Jmol filter'''<ref name="MoodleDocs">[https://docs.moodle.org/36/en/Jmol_filter Official page for the Jmol filter at MoodleDocs]</ref> detects links to molecular model files (.mol, .pdb, .xyz, .cml, ...) in Moodle documents and converts them into embedded JSmol models.  
  
 
Current version of the filter uses by default [[Jmol_JavaScript_Object|'''JSmol_HTML5''']] (i.e. Java is not used). The user can also opt for the [[Jmol_JavaScript_Object/WebGL|'''JSmol_WebGL''' modality]].
 
Current version of the filter uses by default [[Jmol_JavaScript_Object|'''JSmol_HTML5''']] (i.e. Java is not used). The user can also opt for the [[Jmol_JavaScript_Object/WebGL|'''JSmol_WebGL''' modality]].
Line 48: Line 48:
 
# <li value="3">'''Link:''' Use the Moodle text editor (inside a course topic, label, HTML block, forum posting, quiz question, etc.) to add the text for a link, e.g. 'Aspartic acid'. Click and drag to select the text link. Use the ''Insert Web Link'' button and enter the URL of the structure file. Note that the editor may 'scramble' things, particularly if you use additional parameters (below), so you may find it best to use HTML Source ([<>] button) view. The result could be like this: <code><a title="Jmol" href="http://someserver.edu/moodle/file.php/7/Asp.mol">Aspartic acid</a></code>. '''Important:''' the link must have <code>title="Jmol"</code> for it to work properly.
 
# <li value="3">'''Link:''' Use the Moodle text editor (inside a course topic, label, HTML block, forum posting, quiz question, etc.) to add the text for a link, e.g. 'Aspartic acid'. Click and drag to select the text link. Use the ''Insert Web Link'' button and enter the URL of the structure file. Note that the editor may 'scramble' things, particularly if you use additional parameters (below), so you may find it best to use HTML Source ([<>] button) view. The result could be like this: <code><a title="Jmol" href="http://someserver.edu/moodle/file.php/7/Asp.mol">Aspartic acid</a></code>. '''Important:''' the link must have <code>title="Jmol"</code> for it to work properly.
 
# '''Options:'''
 
# '''Options:'''
#* The default size of the display is 350 pixels. You can set it to ''n'' pixels by appending <code>?s=n</code> to the URL: <code><a href="path/Asp.mol?s=200">Aspartic acid</a></code>
+
#* The default size of the display is 350 pixels. You can set it to ''n'' pixels by appending <code>?s=n</code> to the URL: <code><a href="path/Asp.mol?s=200">Aspartic acid</a></code> The user can anyway resize the viewer dragging the bottom-right corner, or click a toggle button to display the viewer full-screen.  When more than one parameter is used in the URL, they are separated with an ampersand (&).
#* You can turn the default controls off by appending <code>?c=0</code> to the URL: <code><a href="path/Asp.mol?s=200&c=0">Aspartic acid</a></code>. When more than one parameter is used, they are separated with an ampersand (&).
+
#* You can specify whether the controls under the viewer are included by appending <code>?c=n</code> to the URL: <code><a href="path/Asp.mol?s=200&c=0">Aspartic acid</a></code>:
 +
#** <code>?c=0</code> to hide the controls.
 +
#** <code>?c=1</code> to display controls suitable for small inorganic or organic chemical structures.
 +
#** <code>?c=2</code> to display instead crystallographic controls for display of unit cells, crystal packing and polyhedra (for data files that support these).
 +
#** <code>?c=3</code> to use controls suitable for biological macromolecules such as proteins or nucleic acids.
 +
#** The default is to show controls according to the type of file loaded (c=3 for pdb, c=2 for cif).
 +
#* You can also specify whether initial display is the interactive structure (<code>?i=0</code>) or it is a cover image, replaced by the interactive object upon user click (<code>?i=1</code>).
 
#* For even greater control, pass a Jmol script to the view by typing <code>JMOLSCRIPT{}</code> after the link. The script goes between the braces. <code><a href="path/Asp.mol?s=200&c=0">Aspartic acid</a>JMOLSCRIPT{color background white; zoom 150; set spin x 10; set spin y 10; spin on;}</code> will set the background to white, zoom in to 150%, and spin the molecule around its X and Y axes.
 
#* For even greater control, pass a Jmol script to the view by typing <code>JMOLSCRIPT{}</code> after the link. The script goes between the braces. <code><a href="path/Asp.mol?s=200&c=0">Aspartic acid</a>JMOLSCRIPT{color background white; zoom 150; set spin x 10; set spin y 10; spin on;}</code> will set the background to white, zoom in to 150%, and spin the molecule around its X and Y axes.
  
:''Credits: A good part of this explanation was copied from the Moodle FAQ at Frostburg State University<ref>[https://web.archive.org/web/20250000000000*/http://marie.frostburg.edu/101/mod/wiki/view.php?id=787&page=Index Archived copy of http://marie.frostburg.edu/101/mod/wiki/view.php?id=787&page=Index] </ref>''
+
:''Credits: A good part of this explanation was copied from the Moodle FAQ at Frostburg State University<ref>[https://web.archive.org/web/20250000000000*/http://marie.frostburg.edu/101/mod/wiki/view.php?id=787&page=Index Archived copy of http://marie.frostburg.edu/101/mod/wiki/view.php?id=787&page=Index] </ref>'' combined with MoodleDocs<ref name="MoodleDocs"></ref>
  
 
=== The Jmol resource for Moodle ===
 
=== The Jmol resource for Moodle ===
 
Jmol models can also be added as [https://docs.moodle.org/20/en/Jmol_resource_type resources].
 
Jmol models can also be added as [https://docs.moodle.org/20/en/Jmol_resource_type resources].
  
 +
<!--
 
=== Moodle sites using Jmol ===
 
=== Moodle sites using Jmol ===
 
If you know a Moodle which uses Jmol, and which is not in the list below, please add it.
 
If you know a Moodle which uses Jmol, and which is not in the list below, please add it.
<!--
+
    * [http://www.reviseguys.com/moodle/course/view.php?id=2 reviseguys Chemistry revision]
* [http://www.reviseguys.com/moodle/course/view.php?id=2 reviseguys Chemistry revision]
+
* [https://moodle.yeovil.ac.uk/ Yeovil College]
 +
* [https://www.monte.nsw.edu.au/ Monte Sant' Angelo Mercy College]
 +
* [https://confchem.ccce.divched.org/2006SpringConfChemP8B Frostburg State University]
 +
* [https://nanoed.tul.cz/course/view.php?id=86 Study (nano)materials at Technical University of Liberec (in Czech)]
 
-->
 
-->
* [http://moodle.yeovil.ac.uk/course/view.php?id=63 Yeovil College]
 
* [http://montenet.monte.nsw.edu.au/ Monte Sant' Angelo Mercy College]
 
* [http://confchem.frostburgchemistry.org Frostburg State University]
 
* [https://nanoed.tul.cz/course/view.php?id=86 Study (nano)materials at Technical University of Liberec (in Czech)]
 
  
 
=== Internationalization ===
 
=== Internationalization ===

Revision as of 15:50, 25 January 2025

Jmol / JSmol Applications

This page is devoted to Content Management Systems, Learning Management Systems, Virtual Learning Environments, e-Learning Platforms..., that have been set-up to use Jmol as part of their contents.

OpenOChem

OpenOChem is an advanced homework/quizzing system that plugs in existing Learning Management Systems via Learning Tools Interoperability® (LTI) specification. There is a 3D model kit based on JSmol

Moodle

Moodle is an open-source course management system.

Molecular model files may be displayed in Moodle pages using a filter, a resource, or placed in searchable databases that students can edit.

Compatibility with recent Moodle versions is uncertain; if you have installed this filter or resource in your Moodle, please contact us[1] with information that might be added here.

The Jmol filter for Moodle

A third-party Jmol filter[2] detects links to molecular model files (.mol, .pdb, .xyz, .cml, ...) in Moodle documents and converts them into embedded JSmol models.

Current version of the filter uses by default JSmol_HTML5 (i.e. Java is not used). The user can also opt for the JSmol_WebGL modality.

  • Download v.6.5 for Moodle 3.6 to 3.8 at least
  • Download v.6.4 for Moodle 2.x and 3.x
  • Download older versions of the the Jmol filter (e.g. for Moodle 1.8 and 1.9)

This is a snapshot of a model inserted in a page using this filter (Moodle v.3.5.2, Jmol Filter v.6.1):

Moodle Filter.png

Inserting molecular models

  • How does the Jmol filter work?
Like the other text filters in Moodle, the Jmol filter expands a simple, shorthand code typed by an author converting it into more complex code the browser can display. Specifically, this filter removes a link to a molecular structure file (with recognized file extension) and inserts a JSmol panel that loads the model. It can optionally insert controls too (e.g. for changing the rendering style).
  • How do I embed molecules into Moodle pages?
  1. Config: First, make sure that the administrators of your Moodle site have installed the Jmol filter.
  2. Upload file: Then, simply upload to your course a molecular structure file and make a link to it using Moodle's HTML editor.
Formats of molecular structure that are recognized as such, based on the file extension (variable $jmolfiletypes in the filter source code):
mol sdf mol2 xyz cml cif mcif pdb csmol jmol pse
mol.png sdf.png mol2.png xyz.png cml.png cif.png mcif.png pdb.png csmol.png jmol.png pse.png
pdb.gz
(png files must be PNGJ files generated by Jmol)
Note that the server must be the same for the uploaded file and the Moodle system files, since Jmol will not display remote files.
  1. Link: Use the Moodle text editor (inside a course topic, label, HTML block, forum posting, quiz question, etc.) to add the text for a link, e.g. 'Aspartic acid'. Click and drag to select the text link. Use the Insert Web Link button and enter the URL of the structure file. Note that the editor may 'scramble' things, particularly if you use additional parameters (below), so you may find it best to use HTML Source ([<>] button) view. The result could be like this: <a title="Jmol" href="http://someserver.edu/moodle/file.php/7/Asp.mol">Aspartic acid</a>. Important: the link must have title="Jmol" for it to work properly.
  2. Options:
    • The default size of the display is 350 pixels. You can set it to n pixels by appending ?s=n to the URL: <a href="path/Asp.mol?s=200">Aspartic acid</a> The user can anyway resize the viewer dragging the bottom-right corner, or click a toggle button to display the viewer full-screen. When more than one parameter is used in the URL, they are separated with an ampersand (&).
    • You can specify whether the controls under the viewer are included by appending ?c=n to the URL: <a href="path/Asp.mol?s=200&c=0">Aspartic acid</a>:
      • ?c=0 to hide the controls.
      • ?c=1 to display controls suitable for small inorganic or organic chemical structures.
      • ?c=2 to display instead crystallographic controls for display of unit cells, crystal packing and polyhedra (for data files that support these).
      • ?c=3 to use controls suitable for biological macromolecules such as proteins or nucleic acids.
      • The default is to show controls according to the type of file loaded (c=3 for pdb, c=2 for cif).
    • You can also specify whether initial display is the interactive structure (?i=0) or it is a cover image, replaced by the interactive object upon user click (?i=1).
    • For even greater control, pass a Jmol script to the view by typing JMOLSCRIPT{} after the link. The script goes between the braces. <a href="path/Asp.mol?s=200&c=0">Aspartic acid</a>JMOLSCRIPT{color background white; zoom 150; set spin x 10; set spin y 10; spin on;} will set the background to white, zoom in to 150%, and spin the molecule around its X and Y axes.
Credits: A good part of this explanation was copied from the Moodle FAQ at Frostburg State University[3] combined with MoodleDocs[2]

The Jmol resource for Moodle

Jmol models can also be added as resources.


Internationalization

A project to internationalize the Jmol filter for Moodle was started on Jan 2008 [1]

A more recent update is including localization, i.e. translated text strings for different languages.

WebAssign

WebAssign® is a Course Management System offered as a service and done by North Carolina State University and Advanced Instructional Systems, Inc.

  • Notice announcing Jmol functionality.

LON-CAPA

LON-CAPA is a "Free Open-Source Distributed Learning Content Management and Assessment System" under continuing development at Michigan State University. There are many exercises in the growing database of shared resources that use Jmol. Most require an account on the system to access the exercises, but a few are published "publicly" and do not require log-in for access. For example:


Drupal

Drupal is an open source content management platform.

Drupal Jmol

A Drupal 7 and 8 module is available to display uploaded molecular structure files as a Jmol applet. The module can be found at http://drupal.org/project/jmol.

Drupal Molecule

Another Drupal module, called Molecule, enables to easily integrate JSmol and JSpecView objects into Drupal sites without technical knowledge. More information at the Molecule site. It is only development version, last updated in 2015.

The Molecule module defines three types of display options for displaying JCAMP-DX files:

  • Spectrum: Show the spectrum contained in the JCAMP-DX file
  • Molecule: Show the molecule contained in the JCAMP-DX file
  • Spectrum with molecule: Show both the molecule and the spectrum in the JCAMP-DX file and link them.


Mahara

The Mahara e-Portfolio system includes the 'Mahara artefact file blocktype jmol/jsmol plugin', which provides the interactive 3D display of chemical structure files, uploaded to Mahara, using Jmol/JSmol.

WordPress

For open source content management system WordPress there is a jsmol2wp plugin, that has been closed as of January 7, 2019 and is not available for download for security issue.


Others

...?