Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
String rewriting systems: case study
1. String rewriting systems: case study
2. String rewriting systems: case study
Here is a short case study of the use of string rewriting systems. As with most string rewriting examples, there are two parts.
Abstract different parts and replace with placeholders.
Reduction by adding the different parts to create instances.
3. CS101 scoring sheets
The CS101 scoring sheets are text-based sheets for each student as part of a largely paper-based and manual-based system for managing the course (aside from certain nodes in the processes that are automated).
Here is an example breakdown text file, generated for each student and which are intended to be edited manually.
CS 101 - Assignment 3 (MS1)
Your grade: _ / 35
Milestone 1: _ / 35
Declare array proper size: _ / 5
Declare array proper type: _ / 5
Obtain user input: _ / 3
Validate user input: _ / 7
Store in proper element: _ / 5
Print correct number: _ / 4
Print correct symbols: _ / 6
Programming style:
Comments:
4. Abstraction
Regular expression pattern matching is used (along with some state) to extract the point slots and way to create totals, add comments, etc. to create a template form as follows. (Note: The JSON text is expanded here for clarity).
[STUDENT]
CS 101 - Assignment 3 (MS1)
Your grade: [PTS0] / 35\
Milestone 1: [PTS1] / 35
Declare array proper size: [PTS2] / 5
Declare array proper type: [PTS3] / 5
Obtain user input: [PTS4] / 3
Validate user input: [PTS5] / 7
Store in proper element: [PTS6] / 5
Print correct number: [PTS7] / 4
Print correct symbols: [PTS8] / 6
Programming style:
[TEXT1]
Comments:
[TEXT2]
When values are available, the placeholders can be replaced with the actual values, or, in the case of, say, "
Comments:", the text for the comments.
5. User interface list of values
A user interface list can be generated in JSON list form as follows.
[
["SUM","PTS0",35,"Your grade:"],
["SUM","PTS1",35,"Milestone 1:"],
["PTS","PTS2",5,"Declare array proper size:"],
["PTS","PTS3",5,"Declare array proper type:"],
["PTS","PTS4",3,"Obtain user input:"],
["PTS","PTS5",7,"Validate user input:"],
["PTS","PTS6",5,"Store in proper element:"],
["PTS","PTS7",4,"Print correct number:"],
["PTS","PTS8",6,"Print correct symbols:"],
["TEXT","TEXT1","Programming style:"],
["TEXT","TEXT2","Comments:"]
]
6. Cascaded scores
The user interface needs to know how to sum cascaded scores. The scores list (a tree structure) is as follows.
[
[1,[2,3,4,5,6,7,8]],
[0,[1]]
],
Note that for ease of processing, the list is in bottom-up fashion so that the root score (at position 0) is computed from the score at position 1 which is a sum of positions 2 through 8.
7. Empty scores
Each student starts with zero points and no text for each field. Here is the
empty.json file for this example.
[0,0,0,0,0,0,0,0,0,"",""]
8. User interface

The user interface can be implemented using client-server communication between a client web browser running JavaScript and a server running Apache and PHP. Here is one way that the point scoring interface could appear.
9. Additional information
In the case of CS101, the following additional information appears.
Input cases used and output of the student's program for that input.
The students program code.
10. Navigation

On the left, navigation is provided between all works and all students (student part omitted that has actual student names). A status (color, etc.) on each student submission is provided as to on-time, late, no submission, and graded or not yet graded.
11. Reduction
At any time, the student sheets can be generated from the scores and the rubric template using string rewriting principles to fill in the placeholders in the rubric template with actual values (points and text).
12. End of page