Sources

Based on NodeJS tutorial on w3schools

Project

Create version zero of syllabus engine. Target is a tool that permits creation of "lessons" that can be assigned to position in a "syllabus" that also has heading material and boilerplate material.

Assume, initially, a database that contains a table of lessons (title, description, content) and table of syllabi which are documents that can include lessons and boilerplate.

Issue: what kind of a "thing" is a syllabus here? My inclination (and practice in prototypes) is to have it be a document that lists lessons that have been assigned to it. That is, the assigning of a lesson to a week in a syllabus happens on the lesson end via a tag. In theory, a given lesson could be assigned to more than one syllabus. Relatedly, a given syllabus is associated with one or more lessons (though section by section and week by week).

Alternatively: a syllabus consists of one or more sections. Sections consist of one or more sessions. Sessions consist of one or more lessons. But can't a lesson extend over more than one session?

sketch01-20180211.png

Maybe there's a new way of thinking about courses here: focus is on SEQUENCE of activities curated by instructor (either what's been called "lessons" or "sessions" above). These might be clustered as a face-to-face class meeting, as a homework assignment, a group project, an exam or other form of assessment.

A syllabus COULD be subdivided into sections/phases, sessions, etc.

<course>::=<section>+
<section>::=<session>+
<session>::=<lesson>+
<lesson>::=<title><description>*<resources>*<instructions><deliverable>*
<title>::=<text>
<description>::=<text>
<resources>::=<text>|<URL>
<instructions>::=<text>
<deliverable>::=<text>

OR, should sessions come in different forms: lecture, workshop, homework, discussion, etc.? Or would that make more sense on the lesson level (so you could have a session that combined those things)?

VERSION 0.0

Syllabus as query that pulls together header material and all matching lessons in order. Here's an "eventually" sketch just to get these ideas on the table and out of the way for now. The idea is that there are lessons that can be added to a course (e.g., tagged for a given session) AND that can be "forked" either before being assigned or once inside a course. The revised version is kept on the family tree back in the lesson database.

sketch02-20180211.png
Getting Started

Set up server with nodeJS.

var http = require('http');
 
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end('This is Course Maker Manager');
}).listen(8080);

We create our own module, current_time.js,

exports.myDateTime = function () {
    return Date();
};

and bring it into the script:

var http = require('http');
var dt = require('./current_time');
 
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write('This is Course Maker Manager<br />');
        res.write("The date and time are: " + dt.myDateTime());
    res.end();
}).listen(8080);

Next we allow our script to read the URL sent to the server:

var http = require('http');
var dt = require('./current_time');
 
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write('This is Course Maker Manager<br />');
        res.write("The date and time are: " + dt.myDateTime() + "<br />");
        res.write("Course Requested is " + req.url);
    res.end();
}).listen(8080);

This is Course Maker Manager
The date and time are: Sun Feb 11 2018 11:47:32 GMT-0800 (PST)
Course Requested is /LAW101

And then we add a query to the URL

var http = require('http');
var dt = require('./current_time');
var url = require('url');
 
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write('This is Course Maker Manager<br />');
        res.write("The date and time are: " + dt.myDateTime() + "<br />");
        res.write("Course Requested is " + req.url + "<br />");
      var q = url.parse(req.url, true).query;
      var txt = q.year + " " + q.month;
      res.end(txt);
 
}).listen(8080);

http://localhost:8080/LAW101?year=2018&month=January

This is Course Maker Manager
The date and time are: Sun Feb 11 2018 13:17:30 GMT-0800 (PST)
Course Requested is /LAW101?year=2018&month=January
2018 January

Next we want to use the script as a file server. We create an html file called "syllabus-header.html":

var http = require('http');
var dt = require('./current_time');
var url = require('url');
var fs = require('fs');
 
http.createServer(function (req, res) {
  fs.readFile('syllabus-header.html', function(err, data) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write('This is Course Maker Manager<br />');
        res.write("The date and time are: " + dt.myDateTime() + "<br />");
 
    res.write(data);
    res.end();
    });
}).listen(8080);
output04.png
But how to put SQL and HTML Page Together?