Parses and displays articulation agreements from assist.org as a flowchart of courses students need to take. Node.js, Express.js, React.js.
- Returns list of origin colleges, destination colleges and majors from assist.org as a JSON object.
- Parses articulation agreements as a JSON object, complete with special conditions. For example, courses which must be taken as a series to satisfy a requirement are parsed as a special group.
- Fetches prerequisite courses for certain requirements listed in agreements.
- Resolves college and major codes from assist.org.
The following algorithms are implemented in /server/parse-agreement.js.
- Articulation agreement text is scraped, trimmed to only the two-column course equivalencies section, and split into lines.
- Two empty buffers are initialized, one for each column.
- A line is halved, with each half containing text from each column.
- The line halves are pushed to their respective buffers.
- Steps 3 through 4 are repeated until all lines corresponding to a single course equivalency have been pushed to the buffer.
- Both buffers are flushed and their contained lines are joined to form a description of a course.
- "One-from-many" requirements are satisfied by taking any course from a list of courses. They are represented by an
ORbetween course equivalencies. - "All-of-above" requirements are represented by an
ANDbetween equivalencies. - The above requirements can be composed together. For example, the requirement
(course_a AND course_b) OR course_cis satisfiable by either taking bothcourse_aas well ascourse_bor only takingcourse_c.
- The course equivalency parsing algorithm above is modified to only flush buffers upon reading all the lines for a single requirement, rather than for a single course equivalency. In other words, when buffers are flushed, they contain "
(course_a AND course_b) OR course_cis equivalent tocourse_d" instead of "course_ais equivalent tocourse_d" - Each requirement is recursively divided into sub-requirements and the relationship between the sub-requirements (
ORorAND) is saved.
With npm installed, run
npm installThen run
yarn devNavigate to
localhost:5000/api?endpoint=Fetch and parse list of origin colleges by appending
originsView colleges with agreements with an origin college with the following, with ORIGIN as the origin's path code.
.../api?endpoint=destinations&origin=ORIGINView majors with the following. Set DESTINATION as destination's path code and YEAR as academic year (i.e. 16-17).
.../api?endpoint=majors&origin=ORIGIN&destination=DESTINATION&year=YEARView the parsed agreement with
.../api?endpoint=agreement&origin=ORIGIN&destination=DESTINATION&year=YEAR&major=MAJORFor example, the following returns the agreement from Allan Hancock College to California Polytechnic University, Pomona in the academic year 15-16 for Architecture B. Arch.
localhost:5000/api?endpoint=agreement&origin=AHC&destination=CPP&year=15-16&major=ARCH