George Mason University Antonin Scalia Law School

Create Course Schedule HTML Table Using R

Referenced in steps below: Course Schedule Instructions.

  1. Save a copy of the original Excel file to come back to later for the Notes sections.
  2. Open up the original Excel file, merge multiple faculty into one row, then delete all the empty rows.
  3. Make sure columns are identical to the column names in script (do not include Room Number or First Name of Instructor). Delete hidden columns (Room Number, First Name of Instructor, etc.). Make sure column names match these: CRN#, CRS#, SEC, Course Title, Instructor, Cr Hr, Days, Time, Room, Exam Date, Exam Time
  4. Make sure footnotes are standardized, e.g., (E) and not (E ) with a space (Update: script has been updated to account for this)
  5. Remove all rows that are not the table header (first row) or the courses.
  6. Save DAY and EVE sheets each as two new csvs by highlighting all cells with data and copying/pasting them into a new file/save as csv (to avoid extra blank columns that may be present by saving entire sheet). Do not open them (especially in Excel) once they are saved, because this may change how the Section numbers are interpreted and may cause 001 to be 1, and so forth.
  7. The R code below covers Steps 2 – 6 in Course Schedule Instructions to create the HTML table.
  8. In R code, update the “dayNotes” variable to match the number of Day Notes. Update the file paths/names for input files and output file.
  9. Paste output into an HTML editor. Copy and paste notes from the copy of the original Excel file to the bottom of the HTML page.
  10. Once everything looks good, paste into MODX.

Instructions for Restoring Course Schedules in MODX

  1. Duplicate the entire course schedule directory. For example: 2016 Course Schedule and rename it to 2015 Course Schedule.
  2. Open up the directory you just copied, select Duplicate of 2016 Fall. Rename Title and Long Title to 2015 Fall. Rename Source Alias to 2015_fall.
  3. Open up the static HTML page.
  4. Search ../../.. and replace with nothing (blank).
  5. Search for .html and replace with nothing (blank).
  6. Search for ../../courses/ and replace with /academics/courses/
  7. Search <img class="icon" src="assets/images/icons/pdf.png" alt="PDF file" width="16" height="16" /> and replace with nothing (blank).
  8. Search <br /><img src="/assets/images/icons/weather_sun.png" alt="" width="16" height="16" /> and replace with nothing (blank).
  9. Search <br /><img src="/assets/images/icons/moon.png" alt="" width="16" height="16" /> and replace with nothing (blank).
  10. Replace <img src="/assets/images/icons/pencil.png" alt="" width="16" height="16" /> and replace with nothing (blank).
  11. Copy the page starting from the list (ul) all the way down to the end of the table (<!-- END HERE-->).
  12. Add this class <div class="table-wrap"> before the opening table element and </div> after the closing table element to make the page responsive.

For anchor links on pages prior to modx, replace:
2000fall.html#
with:
[[~[[*id]]]]#

Add this to the top:

<ul>
<li><a href="[[~[[*id]]]]#schedule">Schedule</a></li>
<li><a href="[[~[[*id]]]]#assignments">Assignments</a></li>
<li><a href="[[~2481]]">Archives</a></li>
</ul>

Remove the following entirely:

<img src="https://www.law.gmu.edu/images/new.gif" alt="" width="25" height="12" border="0">

<img src="assets/images/icons/pdf.gif" alt="PDF Document" width="16" height="16" />

<span style="font-family: Arial,Helvetica,sans-serif;">

<span>

</span>

_2012summer001.html

Replace:

../../courses/

with

/academics/courses/