Annotation of loncom/html/adm/help/tex/Resource_Types.tex, revision 1.10

1.2       bowersj2    1: \label{Resource_Types}
1.1       bowersj2    2: 
1.4       lira        3: LON-CAPA provides several types of resources for organizing your course website. 
1.8       raeburn     4: Resource behavior is determined by file extension. Valid extensions are:
1.4       lira        5: .xml, .html, .xhtml, .htm, .xhtm, .problem, .page, .sequence, .rights,
                      6: .sty, .task, .library, .js, .css, .txt.
1.1       bowersj2    7: 
                      8: \begin{itemize}
1.4       lira        9: \item A \textbf{.css} cascading style sheet file \index{.css}\index{css}\index{cascading style sheet} 
1.8       raeburn    10: can be published for use in multiple courses.
1.4       lira       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
1.5       raeburn    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
1.4       lira       16: at the first publication step).
                     17: 
                     18: \begin{verbatim}
                     19: <startouttext />
                     20: <link rel="stylesheet" index="11"
1.9       raeburn    21: href="/res/yourdomain/yourusername/yourpath/testcss.css" type="text/css" />
1.4       lira       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 />
1.9       raeburn    25: <allow src="/res/yourdomain/yourusername/yourpath/testcss.css" />
1.4       lira       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
1.7       lira       41: {}``.html''. By using the ``New File..'' dropdown, you can enter a file name with one
1.4       lira       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
1.8       raeburn    53: are one of the html varieties. See also the .library file description for xml.
1.4       lira       54: 
                     55: \item A \textbf{.problem} Problem\index{problem}\index{.problem} resource represents problems for the students
1.1       bowersj2   56: to solve, with answers stored in the system. These resources are stored in
1.4       lira       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
1.9       raeburn    68: required for computation).  The Course Editor offers a similar tool called 
1.7       lira       69: a ``Composite page'' which resides within a course rather than in the published
1.4       lira       70: repository.
                     71: 
1.10    ! raeburn    72: The underlying XML structure, and 
1.7       lira       73: behavior of a .page file are the same as used for a ``Composite page'',
1.4       lira       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
1.9       raeburn    78: Course Editor is used.  
1.4       lira       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
1.8       raeburn    84: into the other course from the Course Editor's clipboard.
1.4       lira       85: 
                     86: The course manual describes ways to combine resources in folders, 
1.10    ! raeburn    87: which is an alternative to creating composite pages. A potential advantage of a
        !            88: a composite page is that the browser's inbuilt capabilities can be used to print 
        !            89: all resources included within a page with a single ``Print'' call. 
        !            90: That said, LON-CAPA's own print utility which creates PDFs allows students
        !            91: to print all resources in a folder to a single PDF,
        !            92: which lessens the advantange that accrues from use of a composite page.
        !            93: The disadvantage of use of a published .page is that once a .page
        !            94: is published, reordering or modifying the contents requires use of the resource
        !            95: assembly tool in authoring space, followed by republication. Publishing a .page
1.4       lira       96: in the repository is suggested if the content does not need to change.
                     97: 
                     98: For more information on .pages, see the section \ref{Sequence_Page_Maps}
                     99: 
                    100: \item A \textbf{.js} javascript file contains javascript code which might be referenced
                    101: with HTML in a textblock in a LON-CAPA problem in a manner similar to a .css file.
                    102: 
                    103: \item A \textbf{.library} library file contains LON-CAPA XML which can be imported into
                    104: other .problem files.  Typically a .library file will hold commonly used subroutines, or 
                    105: data structures (to be called in
                    106: LON-CAPA perl script blocks).  It is included in a problem in the
1.7       lira      107: colorful editor by using the ``Import a File'' selection in a dropdown
1.4       lira      108: list in the colorful editor.
                    109: 
                    110: \item A \textbf{.sequence} sequence\index{sequence}\index{.sequence} is a type of \textbf{Map}\index{map}
1.1       bowersj2  111: which is used to link other resources together. The users of this resource
1.4       lira      112: can use links to follow the
1.1       bowersj2  113: sequence. Sequences are stored in files that must use the extension {}``.sequence''.
                    114: Sequences can contain other sequences and pages.
1.4       lira      115: 
                    116: A published sequence contains XML which describes which LON-CAPA resources are to be
                    117: grouped together in a folder. If a .sequence file is imported in its entirety 
                    118: then there is limited
                    119: control over which specific resources are shown, and in which order. The
1.7       lira      120: ``Randomorder'' and ``Randompick'' checkboxes in the Course Editor can be
1.4       lira      121: used to cause the resources to be displayed in a randomorder (randomized
                    122: for each user), and to display M of the total N resources in the
                    123: sequence (again the choice of which M are shown is randomized for each
1.7       lira      124: user).  By contrast, if the ``Import from Assembled Map'', 
                    125: a ``Select Map'' link will allow all resources in the
1.4       lira      126: published sequence to be imported into the current folder, as distinct
                    127: resources, allowing them to be reordered, and cut/removed, as preferred
                    128: using the standard Course Editor tools.
                    129: 
                    130: Conditional sequences are published sequence files for which conditions
                    131: have been specified for one or more links between resources in the map.
1.7       lira      132:  These have to be created using the ``Advanced Edit'' button when creating
1.4       lira      133: a new sequence file in Authoring Space.  These are the types of sequence
                    134: for  which a student's progress through a series of resources can be
                    135: specified. Grading of conditional sequences can be complicated.
                    136: 
1.9       raeburn   137: \item A \textbf{.rights} file is used to specify custom access rights for a published
1.4       lira      138: resource. The access rights to apply to a specific resource are
                    139: specified on publication (or republication) of the resource.  A .rights
                    140: file also must be published to be selectable during resource publication
1.7       lira      141: as a ``Custom Distribution File'' when ``Customized right of use ...'' is selected from the
1.9       raeburn   142: ``Copyright/Distribution'' dropdown list. See the ``Publishing A Resource'' section 
                    143: \ref{Publishing_Copyright}.
1.4       lira      144: 
1.9       raeburn   145: \item A \textbf{.sty} is a LON-CAPA style file used to apply custom styling to specific
1.4       lira      146: tags in a LON-CAPA problem. The styles defined in the file can be applied to display of all
                    147: resources in a course using:
                    148: 
1.6       raeburn   149: Main Menu-$>$Modify course configuration-$>$Display of resources
1.7       lira      150: (checked) + click ``Display'' button-$>$Click ``Select Style File'' link (
1.4       lira      151: Default XML style file item) to launch window to select published .sty
1.7       lira      152: file, then click ``Save Changes'' in main window.
1.4       lira      153: 
                    154: Style files can contain different instructions for different
                    155: targets (e.g., web or tex). For example, the following style file would replace 
1.5       raeburn   156: the $<$h1$>$-tag in all
                    157: incorporated pages by the annoying $<$blink$>$-tag:
1.4       lira      158: 
                    159: \begin{verbatim}
                    160: <definetag name = "h1">
                    161:    <meta></meta>
                    162:    <render>
                    163:       <web><blink></web>
                    164:       <tex>\section{</tex>
                    165:       <latexsource>\section{</latexsource>  
                    166:   </render>
                    167: </definetag>
                    168: 
                    169: 
                    170: <definetag name = "/h1">
                    171:    <meta></meta>
                    172:    <render>
                    173:       <web></blink></web>
                    174:       <tex>}</tex>
                    175:       <latexsource>}</latexsource>  
                    176:   </render>
                    177: </definetag>
                    178: \end{verbatim}
                    179: 
                    180: When printing, LON-CAPA will use the tex \textbackslash section as 
1.5       raeburn   181: $<$h1$>$-rendering.
1.4       lira      182: 
1.9       raeburn   183: Note that .css is perhaps a more modern way to achieve formatting.
1.4       lira      184:  
                    185: \item A \textbf{.task} task file is a bridge task file. Bridge tasks permit
1.8       raeburn   186: assessment using rubrics. See the Bridge Task section \ref{BridgeTask_About}.
1.1       bowersj2  187: \end{itemize}

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