Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic parser rewrite #138

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8a3611b
Working on rewriting the topic parser.
peterasujan Apr 5, 2015
56f9df8
Parsing almost fully written. About to try it.
peterasujan Apr 7, 2015
3c10307
I think I have the basic parser working. Haven't tested on too many t…
peterasujan Apr 7, 2015
e519a87
Couple things.
peterasujan Apr 7, 2015
d7ae669
Got raw html working.
peterasujan Apr 7, 2015
d3d030b
Added example topic -> json in docs.
peterasujan Apr 7, 2015
815953d
Rendering seems to be working okay. Need to test on other topic files…
peterasujan Apr 7, 2015
c30b749
Fixed snap ugliness in section titles.
peterasujan Apr 9, 2015
2daf28d
add test topic file
cycomachead Apr 9, 2015
7219b86
normalize text for spacing
cycomachead Apr 9, 2015
16401e8
Merge branch 'topic-parser-rewrite' of github.com:beautyjoy/llab into…
peterasujan Apr 9, 2015
1688b7d
Fixed raw html bug.
peterasujan Apr 9, 2015
72e793e
normalize tabs
cycomachead Apr 9, 2015
359d789
lots of code cleanup
cycomachead Apr 9, 2015
548a42c
old tags array is not needed.
cycomachead Apr 9, 2015
50c8b8d
more minor code style tweaks and comments
cycomachead Apr 9, 2015
fa28e34
spacing
cycomachead Apr 9, 2015
22826dc
merge with master
cycomachead May 20, 2015
ee10bd1
The course link matches current behavior
cycomachead May 21, 2015
7b2e0ef
course link is in the the top menu on topic pages
cycomachead May 21, 2015
0b3ec9e
comment spacing
cycomachead May 23, 2015
c2eb511
Fix the URL bug in topic rendering
cycomachead May 24, 2015
7505a66
Don't render hidden items on topic pages
cycomachead May 24, 2015
4c7ec1e
mathjax test
cycomachead Jun 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ nav {
.full is needed because the class reference is more specific and the
above rules override these without it.
*/
.full ul ul, .full ol ol,
.full ul ol, .full ol ul {
.full ul ul, .full ol ol,
.full ul ol, .full ol ul {
border: none;
display: block;
margin: none;
Expand Down Expand Up @@ -291,7 +291,7 @@ code { /* Override bootstrap. */
border-radius: 0; /* No round coners on dropdowns between buttons */
}

.arrow {/* For Buttons with arrows instead of words. */
.arrow { /* For Buttons with arrows instead of words. */
border-radius: 8px;
font-variant: small-caps;
width: 3em;
Expand Down
53 changes: 53 additions & 0 deletions docs/1-intro-loops.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
title: Unit 1: Introduction to <span class="snap">snap</span>

{
//What's up with these? --MF
// video: Video Lecture: Abstraction [https://coursesharing.org/courses/6/lectures/7]
// reading: Blown To Bits: Chapter 1 [http://www.bitsbook.com/wp-content/uploads/2008/12/chapter1.pdf]

heading: Lab 1: Introduction
raw-html: <img src="/bjc-r/img/prog/script.png" class="imageRight" alt="Snap! Blocks" />
resource: What is <span class="snap">snap</span> ? [/bjc-r/cur/programming/1-introduction/1-introduction/what-is-snap.html]
resource: Getting Started: Motion Blocks [/bjc-r/cur/programming/1-introduction/1-introduction/motion-blocks.html]
resource: Getting to Know the Interface [/bjc-r/cur/programming/1-introduction/1-introduction/getting-to-know-the-interface.html]
resource: Creating Scripts [/bjc-r/cur/programming/1-introduction/1-introduction/creating-scripts.html]
resource: Pair Programming Swap [/bjc-r/cur/programming/guides/pair-programming-intro.html]
resource: Reporters [/bjc-r/cur/programming/1-introduction/1-introduction/reporters.html]
resource: Saving your work [/bjc-r/cur/programming/1-introduction/1-introduction/saving-your-work.html]

heading: Lab 2: Kaleidoscope
raw-html: <img src="/bjc-r/img/1-introduction/topic1_kaleidoscopegif.gif" class="imageRight" alt="Kaleidoscope Script" />
resource: Position on the Stage [/bjc-r/cur/programming/1-introduction/2-kaleidoscope/position-on-the-stage.html]
resource: The <code>Forever</code> Block [/bjc-r/cur/programming/1-introduction/2-kaleidoscope/forever.html]
resource: Pair Programming Swap [/bjc-r/cur/programming/guides/pair-programming-swap.html?1]
resource: Kaleidoscope [/bjc-r/cur/programming/1-introduction/2-kaleidoscope/kaleidoscope-small.html]

heading: Lab 3: Repeating Commands
resource: The <code>Repeat</code> Block [/bjc-r/cur/programming/1-introduction/3-repeating-commands/the-repeat-block.html]
quiz: Check: Using the Repeat Block [/bjc-r/cur/programming/1-introduction/3-repeating-commands/repeat-self-test.html]
resource: Pair Programming Swap [/bjc-r/cur/programming/guides/pair-programming-swap.html?2]
raw-html: <img src="/bjc-r/img/drawing/draw-star-picture.png" class="imageRight" alt="Drawning a Star"><img src="/bjc-r/img/drawing/draw-star-code-with-blanks.png" class="imageRight" alt="Drawing a Star" />
resource: The <code>For</code> Block [/bjc-r/cur/programming/1-introduction/3-repeating-commands/the-for-block.html]

heading: Lab 4: Making Your Own Blocks
resource: Making a Custom Block [/bjc-r/cur/programming/1-introduction/4-making-your-own-blocks/tutorial-custom-blocks.html]
resource: Adding an Input [/bjc-r/cur/programming/1-introduction/4-making-your-own-blocks/adding-a-simple-input.html]
resource: Pair Programming Swap [/bjc-r/cur/programming/guides/pair-programming-swap.html?3]
resource: Developing and Editing Blocks [/bjc-r/cur/programming/1-introduction/4-making-your-own-blocks/developing-and-editing-blocks.html]
//resource: Bug Dance! [/bjc-r/cur/programming/1-introduction/4-making-your-own-blocks/bug-dance.html]

heading: Lab 5: Building Complicated Blocks with Simple Blocks
raw-html: <img src="/bjc-r/img/drawing/flower-with-6-square-petals.png" class="imageRight" alt="Drawing Flowers" />
resource: Building a Custom Block [/bjc-r/cur/programming/1-introduction/5-building-complicated-blocks/composing-blocks.html]
quiz: Check: Composing with "Buggy" Blocks [/bjc-r/cur/programming/1-introduction/5-building-complicated-blocks/buggy-house-and-square-self-test.html]
resource: Compose a <code>Draw a Flower</code> Block [/bjc-r/cur/programming/1-introduction/5-building-complicated-blocks/draw-a-flower.html]

heading: Lab 6: Using Randomness
//resource: Pair Programming Swap [/bjc-r/cur/programming/guides/pair-programming-swap.html?4]
resource: The <code>Random</code> Block [/bjc-r/cur/programming/1-introduction/6-using-randomness/the-random-block.html]
quiz: Check: The Random Block [/bjc-r/cur/programming/1-introduction/6-using-randomness/random-self-test.html]
resource: Draw a Field of Flowers [/bjc-r/cur/programming/1-introduction/6-using-randomness/draw-field-of-flowers.html]

heading: Investigation
raw-html: This forthcoming student project will serve as the final assessment for the unit.
}
51 changes: 51 additions & 0 deletions docs/concurrency.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
title: Concurrency
{
h2: Big Ideas
big-idea: Understand the basic components of any computer
big-idea: Understand Moore's Law impact on the development of the processors
big-idea: Understand parallelism and its limitations in computing
big-idea: Explore the history and development of encryption techniques

video: Concurrency [https://coursesharing.org/courses/6/lectures/16]
reading: Blown to Bits: Chapter 5 Part 1 [http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt1.pdf]
reading: Blown to Bits: Chapter 5 Part 2 [http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt2.pdf]
reading: Blown to Bits: Chapter 5 Part 3 [http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt3.pdf]

h2: Activities
In <span class="snap">snap</span> what are the issues/facilities to do parallel work, and how does the machine work?

learning-goal: A single sprite has control blocks which appear to respond in parallel (e.g., multiple "when green flag, do...", "when space is clicked, do...", "when I receive broadcast", etc.)
learning-goal: Multiple sprites only exacerbate the problem, and race conditions could occur (e.g., what if multiple sprites tried to paint the screen their color all at the same time?)
learning-goal: What happens when multiple signals are sent to the same "when I receive broadcast" block, do all get through? (yes if Broadcast and wait; no, but consistent, if Broadcast and Edit->Thread Safe Scripts checked; no, but inconsistent, if Edit->Thread Safe Scripts unchecked)
learning-goal: When we call "launch", does that mean another worker starts up? (answer: yes and no)
learning-goal: The meta learning goal for this part is for you to develop an accurate mental model of how Scratch handles concurrency. This is so you avoid race conditions and deadlock, and so that you can fully exploit it to your benefit!


heading: Background: concurrency without the computer
resource: Card Sorting [/bjc-r/cur/programming/sorting/cards/card-sorting.html]
group: Card Sorting: Discussion [/bjc-r/cur/programming/sorting/cards/card-sorting-discuss.html]
resource: Card Sorting: Let's do it [/bjc-r/cur/programming/sorting/cards/card-sorting-lets-do-it.html]
resource: Card Sorting: Reflect [/bjc-r/cur/programming/sorting/cards/card-sorting-reflect.html]
forum: Concurrency in real life... [/bjc-r/cur/programming/concurrency/concurrency-in-real-life.html]

heading: Two heads are better than one.
resource: <span class="snap">snap</span> Machine Concepts [/bjc-r/cur/programming/concurrency/snap/snap-machine-concepts.html]
resource: Concurrency in <span class="snap">snap</span> [/bjc-r/cur/programming/concurrency/snap/snap-play-1.html]
resource: Debugging: Serial vs. Parallel [/bjc-r/cur/programming/concurrency/snap/snap-debug.html]
resource: Reflection [/bjc-r/cur/programming/concurrency/snap/reflection-snap-1.html]

heading: <span class="snap">snap</span> ... don't all talk at once!
resource: Overview: Threads [/bjc-r/cur/programming/concurrency/snap/overview-snap-2.html]
resource: Determinism vs. Non-determinism [/bjc-r/cur/programming/concurrency/snap/snap-modify.html]
resource: What are the possible values? [/bjc-r/cur/programming/concurrency/snap/read-and-finish-with-n-script-snap.html]
//quiz: Quiz
resource: Race Conditions in <span class="snap">snap</span> [/bjc-r/cur/programming/concurrency/snap/snap-play-2.html]
resource: These are the possible values [/bjc-r/cur/programming/concurrency/snap/read-and-finish-with-n-answer-snap.html]

heading: <span class="snap">snap</span> ... some details to form a mental model
resource: Overview: Broadcasts [/bjc-r/cur/programming/concurrency/snap/overview-snap-3.html]
resource: Multiple Broadcasts [/bjc-r/cur/programming/concurrency/snap/snap-play-3.html]
resource: Reflection: Multiple Broadcasts [/bjc-r/cur/programming/concurrency/snap/reflection-snap-3.html]


}
228 changes: 228 additions & 0 deletions docs/concurrency_topic_model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
{
"topics": [
{
"type": "topic",
"url": "",
"contents": [
{
"title": " Big Ideas",
"contents": [
{
"type": "big-idea",
"contents": " Understand the basic components of any computer",
"indent": 0
},
{
"type": "big-idea",
"contents": " Understand Moore's Law impact on the development of the processors",
"indent": 0
},
{
"type": "big-idea",
"contents": " Understand parallelism and its limitations in computing",
"indent": 0
},
{
"type": "big-idea",
"contents": " Explore the history and development of encryption techniques",
"indent": 0
},
{
"type": "video",
"indent": 0,
"contents": " Concurrency ",
"url": "https://coursesharing.org/courses/6/lectures/16"
},
{
"type": "reading",
"indent": 0,
"contents": " Blown to Bits: Chapter 5 Part 1 ",
"url": "http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt1.pdf"
},
{
"type": "reading",
"indent": 0,
"contents": " Blown to Bits: Chapter 5 Part 2 ",
"url": "http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt2.pdf"
},
{
"type": "reading",
"indent": 0,
"contents": " Blown to Bits: Chapter 5 Part 3 ",
"url": "http://inst.eecs.berkeley.edu/~cs10/sp12/readings/BtB5-pt3.pdf"
}
],
"type": "section",
"headingType": "h2"
},
{
"title": " Activities",
"contents": [
{
"indent": 0,
"contents": "In snap what are the issues/facilities to do parallel work, and how does the machine work?"
},
{
"type": "learning-goal",
"contents": " A single sprite has control blocks which appear to respond in parallel (e.g., multiple \"when green flag, do...\", \"when space is clicked, do...\", \"when I receive broadcast\", etc.)",
"indent": 0
},
{
"type": "learning-goal",
"contents": " Multiple sprites only exacerbate the problem, and race conditions could occur (e.g., what if multiple sprites tried to paint the screen their color all at the same time?)",
"indent": 0
},
{
"type": "learning-goal",
"contents": " What happens when multiple signals are sent to the same \"when I receive broadcast\" block, do all get through? (yes if Broadcast and wait; no, but consistent, if Broadcast and Edit->Thread Safe Scripts checked; no, but inconsistent, if Edit->Thread Safe Scripts unchecked)",
"indent": 0
},
{
"type": "learning-goal",
"contents": " When we call \"launch\", does that mean another worker starts up? (answer: yes and no)",
"indent": 0
},
{
"type": "learning-goal",
"contents": " The meta learning goal for this part is for you to develop an accurate mental model of how Scratch handles concurrency. This is so you avoid race conditions and deadlock, and so that you can fully exploit it to your benefit!",
"indent": 0
}
],
"type": "section",
"headingType": "h2"
},
{
"title": " Background: concurrency without the computer",
"contents": [
{
"type": "resource",
"indent": 0,
"contents": " Card Sorting ",
"url": "/bjc-r/cur/programming/sorting/cards/card-sorting.html"
},
{
"type": "group",
"indent": 0,
"contents": " Card Sorting: Discussion ",
"url": "/bjc-r/cur/programming/sorting/cards/card-sorting-discuss.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Card Sorting: Let's do it ",
"url": "/bjc-r/cur/programming/sorting/cards/card-sorting-lets-do-it.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Card Sorting: Reflect ",
"url": "/bjc-r/cur/programming/sorting/cards/card-sorting-reflect.html"
},
{
"type": "forum",
"indent": 0,
"contents": " Concurrency in real life... ",
"url": "/bjc-r/cur/programming/concurrency/concurrency-in-real-life.html"
}
],
"type": "section",
"headingType": "heading"
},
{
"title": " Two heads are better than one.",
"contents": [
{
"type": "resource",
"indent": 0,
"contents": " snap Machine Concepts ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-machine-concepts.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Concurrency in snap ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-play-1.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Debugging: Serial vs. Parallel ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-debug.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Reflection ",
"url": "/bjc-r/cur/programming/concurrency/snap/reflection-snap-1.html"
}
],
"type": "section",
"headingType": "heading"
},
{
"title": " snap ... don't all talk at once!",
"contents": [
{
"type": "resource",
"indent": 0,
"contents": " Overview: Threads ",
"url": "/bjc-r/cur/programming/concurrency/snap/overview-snap-2.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Determinism vs. Non-determinism ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-modify.html"
},
{
"type": "resource",
"indent": 0,
"contents": " What are the possible values? ",
"url": "/bjc-r/cur/programming/concurrency/snap/read-and-finish-with-n-script-snap.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Race Conditions in snap ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-play-2.html"
},
{
"type": "resource",
"indent": 0,
"contents": " These are the possible values ",
"url": "/bjc-r/cur/programming/concurrency/snap/read-and-finish-with-n-answer-snap.html"
}
],
"type": "section",
"headingType": "heading"
},
{
"title": " snap ... some details to form a mental model",
"contents": [
{
"type": "resource",
"indent": 0,
"contents": " Overview: Broadcasts ",
"url": "/bjc-r/cur/programming/concurrency/snap/overview-snap-3.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Multiple Broadcasts ",
"url": "/bjc-r/cur/programming/concurrency/snap/snap-play-3.html"
},
{
"type": "resource",
"indent": 0,
"contents": " Reflection: Multiple Broadcasts ",
"url": "/bjc-r/cur/programming/concurrency/snap/reflection-snap-3.html"
}
],
"type": "section",
"headingType": "heading"
}
]
}
],
"title": " Concurrency"
}
3 changes: 2 additions & 1 deletion loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ llab.paths.css_files.push('css/default.css');
llab.paths.scripts[0] = [];
llab.paths.scripts[0].push(llab.CONFIG_FILE_PATH);
llab.paths.scripts[0].push("lib/jquery/dist/jquery.min.js");
llab.paths.scripts[0].push("//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML");

llab.loaded['config'] = false;
llab.paths.stage_complete_functions[0] = function() {
Expand Down Expand Up @@ -158,7 +159,7 @@ llab.initialSetUp = function() {

function loadScriptsAndLinks(stage_num) {
var i, tag;

// load css files
while (llab.paths.css_files.length != 0) {
tag = getTag("link", llab.paths.css_files.shift(), "text/css");
Expand Down
2 changes: 1 addition & 1 deletion script/curriculum.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* Dependencies:
* jQuery
* library.js
* (Bootsrap) - optional, needed for looks, if missing code will still run
*/

llab.file = "";
Expand Down Expand Up @@ -284,6 +283,7 @@ llab.setupTitle = function() {
// Special Case for Snap! in titles.
document.title = document.title.replace('snap', 'Snap!');

// FIXME -- refactor.
$(document.body).css('padding-top', $('.llab-nav').height() + 10);
document.body.onresize = function(event) {
$(document.body).css('padding-top', $('.llab-nav').height() + 10);
Expand Down
Loading