Skip to content

CourseSourceWorkflow

M. Drew LaMar edited this page May 11, 2022 · 2 revisions

Adding articles

  • Export article from eJournalPress to QUBES
  • Download zip file for article and unzip on local computer
  • PANDOC
    • Open ######-####DLesson-file001.docx and
      • Remove field codes (dark grey highlight - press Command 6)
      • Make sure references are in list form
      • Make sure the following sections have header settings: Learning Goals, Learning Objectives, Active Learning, Inclusive Teaching, Assessment, References, Abstract, Introduction
    • Open terminal and cd into the doc directory
    • In terminal, run the command
      docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/core ######-####DLesson-file001.doc -o ######-####DLesson-file001.html
      
    • Repeat the above command for all tables, but add the command --extract-media=. to extract images (if any)
    • If images in tables, after imported, upload images to gallery
    • Sometimes table header is not under <thead>
      • Add <thead>
      • Replace class of first <tr> to <tr class="header">
      • Change all <td> to <th>
  • Change to the parent directory of the unzipped article directory
    export COPYFILE_DISABLE=true; tar cvzf ######-####DLesson.tar.gz ######-####DLesson
    
  • Copy .tar.gz file into project directory on vagrant machine and unzip
    /srv/example/projects/ejournalpressftp/files/
    
  • Run migration script
    php muse migration -r=app/site/groups/1052/helpers --file=Migration20210906000000SgCoursesource.php -d=down -f
    
  • Possible issues with script:
    • Some references with dates, like (2003), are being incorrectly linked to references.
    • "Tools and Strategies" and Reviews start with "main-text" and not "introduction"

Convert from tiff to png with width of 800

convert example.tiff -resize 800 example.png

FTP folder to QUBES:

  • sftp mdlama@qubeshub.org
    • cd data/data/projects/ejournalpressftp/files
    • put -r ######-####DLesson

After upload:

  • Insert tables
  • Insert figures
    • Rename figures from filename to "Figure 1", "Figure 2", etc.
    • [[{"fid":"0","attributes":{"alt":"Figure 1","title":"Figure 1"},"fields":{"field_caption[und][0][value]":""}}]]
    • For caption:
      • https://www.urlencoder.org/
      • Be careful with "<" and superscripts. Replace with HTML entities, i.e.
        • < gets replaced with &lt;
        • X2 gets replaced with X&sup2;

For tables

  • Use Advanced Symbols or equations
    • For check marks: <td style="text-align: center; font-size: 1.5em;"><i class="far fa-check-square">&nbsp;</i></td>
  • For tables with upper-left notches:
    • See https://qubeshub.org/community/groups/coursesource/publications?id=2782&v=1 (Table 2)
        <thead>
        <tr class="header">
        	<th class="hidden" style="border-left: none;border-top:none;border-bottom:none;">&nbsp;</th>
        	<th colspan="5"><strong>Hypothesis, Predictions and Experimental Design</strong></th>
        </tr>
      </thead>
      <tbody>
          <tr class="odd">
        	  <td class="hidden" style="border-left: none;border-top:none;">&nbsp;</td>
          ...
        </tr>
        ...
      </tbody>
      
  • If using images, use jpg or png

Script changes:

  • Remove all blockquotes!!! (in particular within list li elements)
    • Can replace blockquotes in Lesson Learning Goals with margin-left 50px (or just style that way)
  • Capture citation such as (e.g., ##)
    • Another example: (words; 16, 16)
  • Don't capture citations that are dates
  • Grab Article Type from filename
  • Make sure keywords don't start with numbers!!! (i.e. 1., 2., 3., etc.)
  • CSS changes: put some space after tables and figures
  • Figure out "Other" based on which tags it is grouped with (e.g. 022021-0007HLession: Reflective Writing, Interactive Lecture, Other)
  • From eJPress XML, if .tif, auto-convert to .png and edit XML

Finally, copy folder to Google Drive

Adding Course

  • Add course to sg_coursesource.course table
  • Add course to Overview page (needs approval)
  • Create tag in example.jos_tags for course in admin interface with
    • tag: sgcoursesourcecourse<sg_coursesource.course.id>
    • raw_tag: sg_coursesource.course <sg_coursesource.course.id>
    • admin: 1
  • Put jos_tags.id in sg_coursesource.course.tag_id for course.
  • Icon
    • Get icon from The Noun Project
    • convert noun-icon.png -trim -resize 64x64\> noun-icon-small.png
    • Put icon in app/site/groups/<group id>/uploads/media/images/courses
    • Put filename of icon in sg_coursesource.course.logo_img

Clone this wiki locally