File:  [LON-CAPA] / loncom / html / adm / help / tex / Resource_Types.tex
Revision 1.9: download - view: text, annotated - select for diffs
Mon Sep 9 20:51:06 2013 UTC (10 years, 10 months ago) by raeburn
Branches: MAIN
CVS tags: HEAD
- Fix typo.
- Consistent formatting
- URLs for items in /res require domain.

    1: \label{Resource_Types}
    2: 
    3: LON-CAPA provides several types of resources for organizing your course website. 
    4: Resource behavior is determined by file extension. Valid extensions are:
    5: .xml, .html, .xhtml, .htm, .xhtm, .problem, .page, .sequence, .rights,
    6: .sty, .task, .library, .js, .css, .txt.
    7: 
    8: \begin{itemize}
    9: \item A \textbf{.css} cascading style sheet file \index{.css}\index{css}\index{cascading style sheet} 
   10: can be published for use in multiple courses.
   11: Use of a specific CSS style within a resource can be set using an html tag within a text
   12: block that refers to a class by name, where the class is included in the
   13: published css file.  You would specify use
   14: of the css file with a $<$link$>$ tag, and indicate a file dependency with
   15: an allow tag (if the $<$allow$>$ tag is not specified LON-CAPA should add it
   16: at the first publication step).
   17: 
   18: \begin{verbatim}
   19: <startouttext />
   20: <link rel="stylesheet" index="11"
   21: href="/res/yourdomain/yourusername/yourpath/testcss.css" type="text/css" />
   22: <span class="Yellow">After the Earth and Mars, which other body in our
   23: solar system is thought to be the next most likely site for finding
   24: life?</span><endouttext />
   25: <allow src="/res/yourdomain/yourusername/yourpath/testcss.css" />
   26: 
   27: where testcss.css contains:
   28: 
   29: .Yellow {
   30:   color: yellow;
   31: }
   32: \end{verbatim}
   33: 
   34: It also possible to indicate use of a css file within a course,
   35: course-wide, for a specific folder, or specific resource etc, by setting
   36: the parameter: CSS file to link [Part: 0] (cssfile).
   37: 
   38: \item A \textbf{.html} HTML file\index{HTML file}\index{content page}\index{.htm, .html, xhtm, xhtml}, 
   39: (formerly known as a Content Page), displays course content. It is a conventional HTML page. 
   40: These resources use the extension
   41: {}``.html''. By using the ``New File..'' dropdown, you can enter a file name with one
   42: of the other extensions, htm, xhtml, xhtm, xml. For more information see the section \ref{Content_Page_Overview}.
   43: 
   44: Although the extensions: xhtml and xhtm imply that the file should be
   45: xhtml compliant (i.e., be a valid document, according to w3c validation
   46: meaning (amongst other things): all elements closed; attributes
   47: case-sensitive; attributes required by certain elements, certain
   48: specials characters need to be included as entities in some attributes
   49: etc.), LON-CAPA does not test whether a document with an xhtml extension
   50: is actually valid xhtml.
   51: 
   52: Files of type .xml are supported for legacy files, but it is suggested that new files
   53: are one of the html varieties. See also the .library file description for xml.
   54: 
   55: \item A \textbf{.problem} Problem\index{problem}\index{.problem} resource represents problems for the students
   56: to solve, with answers stored in the system. These resources are stored in
   57: files that must use the extension {}``.problem''. Problems are coded in a combination
   58: of Perl and xml markup tags. Most of this manual concerns authoring problems. For an overview
   59: see the section \ref{Problem_Types}
   60: 
   61: \item A \textbf{.page} Page\index{page}\index{.page} is a type of \textbf{Map}\index{map} which
   62: is used to join other resources together into one HTML page. For example,
   63: a page of problems will appears as a problem set. These resources are stored
   64: in files that must use the extension {}``.page''. 
   65: 
   66: For performance purposes it is best not to include too may resources in a
   67: .page (8 would be a good limit; and likely fewer if maxima or R are
   68: required for computation).  The Course Editor offers a similar tool called 
   69: a ``Composite page'' which resides within a course rather than in the published
   70: repository.
   71: 
   72: The underying XML structure, and 
   73: behavior of a .page file are the same as used for a ``Composite page'',
   74: which can be added to a course using the Course Editor.  One difference
   75: between the two is that for a .page in Authoring Space,  one of the
   76: Authoring Space editors (Simple Edit or Advanced Edit) will be used to
   77: modify the contents of the file, whereas for a Composite Page, the
   78: Course Editor is used.  
   79: 
   80: Options for reuse of a course Composite page are: (a) use cloning to copy
   81: everything from the old course to the new; (b) as course coordinator, 
   82: copy the Composite map into the Course Editor's clipboard, change role to 
   83: course coordintator in a different course, and past the item
   84: into the other course from the Course Editor's clipboard.
   85: 
   86: The course manual describes ways to combine resources in folders, 
   87: which is an alternative to creating composite pages. The advantage of a .page
   88: is that they can be printed all at once. The disadvantage is that once a .page
   89: is published, the contents are more difficult to change. Publishing a .page
   90: in the repository is suggested if the content does not need to change.
   91: 
   92: For more information on .pages, see the section \ref{Sequence_Page_Maps}
   93: 
   94: \item A \textbf{.js} javascript file contains javascript code which might be referenced
   95: with HTML in a textblock in a LON-CAPA problem in a manner similar to a .css file.
   96: 
   97: \item A \textbf{.library} library file contains LON-CAPA XML which can be imported into
   98: other .problem files.  Typically a .library file will hold commonly used subroutines, or 
   99: data structures (to be called in
  100: LON-CAPA perl script blocks).  It is included in a problem in the
  101: colorful editor by using the ``Import a File'' selection in a dropdown
  102: list in the colorful editor.
  103: 
  104: \item A \textbf{.sequence} sequence\index{sequence}\index{.sequence} is a type of \textbf{Map}\index{map}
  105: which is used to link other resources together. The users of this resource
  106: can use links to follow the
  107: sequence. Sequences are stored in files that must use the extension {}``.sequence''.
  108: Sequences can contain other sequences and pages.
  109: 
  110: A published sequence contains XML which describes which LON-CAPA resources are to be
  111: grouped together in a folder. If a .sequence file is imported in its entirety 
  112: then there is limited
  113: control over which specific resources are shown, and in which order. The
  114: ``Randomorder'' and ``Randompick'' checkboxes in the Course Editor can be
  115: used to cause the resources to be displayed in a randomorder (randomized
  116: for each user), and to display M of the total N resources in the
  117: sequence (again the choice of which M are shown is randomized for each
  118: user).  By contrast, if the ``Import from Assembled Map'', 
  119: a ``Select Map'' link will allow all resources in the
  120: published sequence to be imported into the current folder, as distinct
  121: resources, allowing them to be reordered, and cut/removed, as preferred
  122: using the standard Course Editor tools.
  123: 
  124: Conditional sequences are published sequence files for which conditions
  125: have been specified for one or more links between resources in the map.
  126:  These have to be created using the ``Advanced Edit'' button when creating
  127: a new sequence file in Authoring Space.  These are the types of sequence
  128: for  which a student's progress through a series of resources can be
  129: specified. Grading of conditional sequences can be complicated.
  130: 
  131: \item A \textbf{.rights} file is used to specify custom access rights for a published
  132: resource. The access rights to apply to a specific resource are
  133: specified on publication (or republication) of the resource.  A .rights
  134: file also must be published to be selectable during resource publication
  135: as a ``Custom Distribution File'' when ``Customized right of use ...'' is selected from the
  136: ``Copyright/Distribution'' dropdown list. See the ``Publishing A Resource'' section 
  137: \ref{Publishing_Copyright}.
  138: 
  139: \item A \textbf{.sty} is a LON-CAPA style file used to apply custom styling to specific
  140: tags in a LON-CAPA problem. The styles defined in the file can be applied to display of all
  141: resources in a course using:
  142: 
  143: Main Menu-$>$Modify course configuration-$>$Display of resources
  144: (checked) + click ``Display'' button-$>$Click ``Select Style File'' link (
  145: Default XML style file item) to launch window to select published .sty
  146: file, then click ``Save Changes'' in main window.
  147: 
  148: Style files can contain different instructions for different
  149: targets (e.g., web or tex). For example, the following style file would replace 
  150: the $<$h1$>$-tag in all
  151: incorporated pages by the annoying $<$blink$>$-tag:
  152: 
  153: \begin{verbatim}
  154: <definetag name = "h1">
  155:    <meta></meta>
  156:    <render>
  157:       <web><blink></web>
  158:       <tex>\section{</tex>
  159:       <latexsource>\section{</latexsource>  
  160:   </render>
  161: </definetag>
  162: 
  163: 
  164: <definetag name = "/h1">
  165:    <meta></meta>
  166:    <render>
  167:       <web></blink></web>
  168:       <tex>}</tex>
  169:       <latexsource>}</latexsource>  
  170:   </render>
  171: </definetag>
  172: \end{verbatim}
  173: 
  174: When printing, LON-CAPA will use the tex \textbackslash section as 
  175: $<$h1$>$-rendering.
  176: 
  177: Note that .css is perhaps a more modern way to achieve formatting.
  178:  
  179: \item A \textbf{.task} task file is a bridge task file. Bridge tasks permit
  180: assessment using rubrics. See the Bridge Task section \ref{BridgeTask_About}.
  181: \end{itemize}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>