Skip to content

Instantly share code, notes, and snippets.

@knowuh
Created August 29, 2012 19:16
Show Gist options
  • Save knowuh/3517443 to your computer and use it in GitHub Desktop.
Save knowuh/3517443 to your computer and use it in GitHub Desktop.
{
"type": "mysystem2",
"prompt": "<h1>Scrolling HTML instruction text goes here.</h1>\nYeah, you can include images too!\n\n<img src=\"http://www.lekraken.com/wp-content/uploads/2009/05/turumaki.gif\">\n\n",
"modules": [
{
"name": "Glucose",
"icon": "http://dl.dropbox.com/u/73403/mysystem/images/egg-transp-70.png",
"image": "assets/glucose.png",
"xtype": "MySystemContainer",
"etype": "source",
"fields": {
"efficiency": "1"
},
"uuid": "d9a00071-5f44-47b2-a6a9-d0b43a31101e"
},
{
"name": "Sun",
"icon": "http://dl.dropbox.com/u/73403/mysystem/images/pot.jpg",
"image": "assets/sun.png",
"xtype": "MySystemContainer",
"etype": "source",
"fields": {
"efficiency": "1"
},
"uuid": "874cf450-0383-4872-8c6d-2592bb3a2291"
},
{
"name": "Mitochondria",
"icon": "http://dl.dropbox.com/u/73403/mysystem/images/water-70.png",
"image": "assets/mitochondria.png",
"xtype": "MySystemContainer",
"etype": "source",
"fields": {
"efficiency": "1"
},
"uuid": "9b8744d5-ac29-47c1-be0d-cb3437a199b1"
},
{
"xtype": "MySystemContainer",
"etype": "source",
"fields": {
"efficiency": "1"
},
"image": "assets/chloroplast.png",
"name": "Chloroplast",
"uuid": "26a808e3-e3c0-4354-8e87-e8abf83c46cc"
},
{
"xtype": "MySystemContainer",
"etype": "source",
"fields": {
"efficiency": "1"
},
"name": "Plant",
"image": "assets/plant.png",
"uuid": "db7e251c-c584-4b7a-b8bd-b7f4ceb0e1b1"
}
],
"energy_types": [
{
"label": "Light energy",
"color": "#fdb900",
"uuid": "5565ad8c-27fa-41e3-835e-b20b562b5ded"
},
{
"label": "Heat energy",
"color": "#FF0000",
"uuid": "1bb1b7ed-5266-4377-8f33-c94dcffe98a6"
},
{
"label": "Infrared Radiation (IR)",
"color": "#91219E",
"uuid": "4a4710b0-7419-4b7b-964a-40c2bd992763"
},
{
"label": "(Stored) Chemical energy",
"color": "#006838",
"uuid": "b78f00ac-3c73-4e78-b669-7ee86537b021"
},
{
"label": "(Usable) Chemical energy",
"color": "#006838",
"uuid": "a6a05b05-3898-40cf-8139-c9cdbe5be022"
}
],
"diagram_rules": [
{
"comparison": "exactly",
"type": "Sun",
"not": false,
"number": "1",
"hasLink": true,
"energyType": "Light energy",
"linkDirection": "-->",
"otherNodeType": "Chloroplast",
"suggestion": "There are some links missing in your diagram.",
"category": "Source",
"name": "Source 1",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Sun",
"not": false,
"hasLink": true,
"energyType": "Light energy",
"linkDirection": "-->",
"otherNodeType": "Plant",
"number": "1",
"suggestion": "There are some links missing in your diagram.",
"category": "Source",
"name": "Source 2 ",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Chloroplast",
"number": "1",
"hasLink": true,
"energyType": "(Stored) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Glucose",
"suggestion": "You should revise your diagram.",
"category": "Transformation",
"name": "Transformation 1",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Glucose",
"number": "1",
"hasLink": true,
"otherNodeType": "Plant",
"linkDirection": "-->",
"suggestion": "You should revise your links.",
"energyType": "(Stored) Chemical energy",
"category": "Storage",
"name": "Storage",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Mitochondria",
"number": "1",
"hasLink": true,
"energyType": "(Usable) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Plant",
"suggestion": "You should revise your links.",
"category": "Release",
"name": "Release",
"isJavascript": false
},
{
"comparison": "more than",
"type": "node",
"number": "0",
"hasLink": true,
"energyType": "any",
"linkDirection": "-->",
"otherNodeType": "node",
"category": "Link",
"name": "Link",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Mitochondria",
"number": "1",
"hasLink": true,
"energyType": "(Usable) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Plant",
"category": "none",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Sun",
"number": "1",
"hasLink": true,
"energyType": "Light energy",
"linkDirection": "-->",
"otherNodeType": "Plant",
"category": "none",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Plant",
"number": "1",
"hasLink": true,
"energyType": "Light energy",
"linkDirection": "-->",
"otherNodeType": "Chloroplast",
"category": "none",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Glucose",
"number": "1",
"hasLink": true,
"energyType": "(Stored) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Plant",
"category": "none",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Plant",
"number": "1",
"hasLink": true,
"energyType": "(Stored) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Mitochondria",
"category": "none",
"isJavascript": false
},
{
"comparison": "exactly",
"type": "Plant",
"number": "1",
"hasLink": true,
"energyType": "(Stored) Chemical energy",
"linkDirection": "-->",
"otherNodeType": "Glucose",
"category": "none",
"isJavascript": true
},
{
"comparison": "more than",
"type": "Plant",
"number": "1",
"not": true,
"category": "none",
"isJavascript": false
},
{
"comparison": "more than",
"type": "Sun",
"number": "1",
"not": true,
"category": "none",
"isJavascript": false
},
{
"comparison": "more than",
"type": "Glucose",
"number": "1",
"not": true,
"category": "none",
"isJavascript": false
},
{
"comparison": "more than",
"type": "Mitochondria",
"number": "1",
"not": true,
"category": "none",
"isJavascript": false
},
{
"comparison": "more than",
"type": "Chloroplast",
"number": "1",
"not": true,
"category": "none",
"isJavascript": true
}
],
"maxFeedbackItems": "1",
"correctFeedback": "<div> congrats </div>",
"minimumRequirementsFeedback": "<div style=\"color: red;\"> Boo. Need something stronger. </div>",
"enableNodeDescriptionEditing": false,
"enableLinkDescriptionEditing": false,
"enableLinkLabelEditing": false,
"enableCustomRuleEvaluator": true,
"customRuleEvaluator": "/*globals MySystem rules nodes suggestions*/\n\n//Energy Source (sun->chlo or sun->plant->chlro)\nif(!(rules.objectAt(0).check(nodes)||(rules.objectAt(7).check(nodes)&& rules.objectAt(8).check(nodes)))){\nsuggestions.pushObject(\"Your diagram does not show how the sun helps plants grow. Go back to Step 1.2 to find out and revise your diagram.\");\n} \n\n\n//Energy Transform\n// No transformation or Incorrect Transformation\nif(!rules.objectAt(1).check(nodes)){\nsuggestions.pushObject(\"Use evidence from Step 1.2 and Step 1.3 and revise your diagram to show what happens to light energy during photosynthesis.\");\n} else if (rules.objectAt(1).check(nodes)&&!rules.objectAt(2).check(nodes)){\nsuggestions.pushObject(\"We’ve detected a problem with your diagram. Use evidence from Step 1.2 and Step 1.3 and revise your diagram to show how energy is transformed.\");\n}\n\n\n//Energy release I\n//Glucose->mito\nif(!rules.objectAt(3).check(nodes)){\nsuggestions.pushObject(\"Your diagram does not show what plants do with glucose during cellular respiration. Review the visualizations in Step 3.3 and Step 3.9 to find out and improve your diagram.\");\n} else if (rules.objectAt(3).check(nodes)&&!rules.objectAt(4).check(nodes)){\nsuggestions.pushObject(\"We’ve detected a problem with your diagram. What kind of energy is stored in glucose? Go back to Step 3.3 to find out and revise your diagram.\");\n} \n\n//Energy release II\n//Mitochondria->Plant\nif(!rules.objectAt(5).check(nodes)){\nsuggestions.pushObject(\"Your diagram does not show what mitochondria do during cellular respiration. Review the visualizations in Step 3.3 and Step 3.9 to find out and improve your diagram.\");\n} else if (rules.objectAt(5).check(nodes)&&!rules.objectAt(6).check(nodes)){\nsuggestions.pushObject(\"Revise your diagram to show how energy is released during cellular respiration. Use the visualization in Step 3.9 to find out.\");\n} \n//”Storage feedback”: Glucose -> Plant \nif(!(rules.objectAt(9).check(nodes) )) {\n suggestions.pushObject(\"Review the visualization in Step 3.3 to find out what plants do with the extra glucose and revise your diagram.\");\n}\n//icons\nif(!(rules.objectAt(12).check(nodes)&&rules.objectAt(13).check(nodes) &&rules.objectAt(14).check(nodes) &&rules.objectAt(15).check(nodes) &&rules.objectAt(16).check(nodes))) {\n suggestions.pushObject(\"You can use each icon only ONCE. Use evidence from the project and revise your diagram.\");\n}\n\n\n\n// Look for links that don't match one of the 'should' link rules\nvar links = MySystem.store.find(MySystem.Link),\n notAllowedLink;\nlinks = links.filter(function (link) {return link.isComplete();});\nnotAllowedLink = links.find(function (link) {\n var positiveLinkRules = rules.filterProperty('hasLink').filter(function(rule){return !rule.get('not');});\n var matchingRule = positiveLinkRules.find(function (rule) {\n // need to handle the link check here, in the future this should be moved into the core code\n var paletteItem = rule.paletteItem(rule.get('type')),\n otherPaletteItem = rule.paletteItem(rule.get('otherNodeType'));\n \n switch(rule.get('linkDirection')) {\n case '-->':\n return rule.checkLink(link, paletteItem, otherPaletteItem);\n case '<--':\n return rule.checkLink(link, otherPaletteItem, paletteItem);\n case '---':\n return rule.checkLink(link, paletteItem, otherPaletteItem) || rule.checkLink(link, otherPaletteItem, paletteItem);\n default:\n throw \"Invalid linkDirection value for diagram rule.\";\n }\n });\n if(!matchingRule){ return YES; };\n});\n\nif(notAllowedLink) {\n suggestions.pushObject(\"You have some incorrect links in your diagram. Use evidence from the project and revise your diagram. \");\n}\n",
"minimum_requirements": [
{
"type": "node",
"comparison": "more than",
"number": ""
}
],
"enableNodeLabelEditing": false,
"maxSubmissionClicks": "32",
"maxSubmissionFeedback": "Sorry, but you have submitted your diagram more than three times. Please continue working without feedback.",
"feedbackPanelHeight": 250,
"feedbackPanelWidth": 500,
"terminalRadius": 14,
"nodeWidth": "80",
"nodeHeight": "80",
"backgroundImage": "https://dl.dropbox.com/u/1077325/640x800.jpeg",
"backgroundImageScaling": false,
"enableNodeLabelDisplay": false,
"rubric_categories": [
{
"name": "Source"
},
{
"name": "Transformation"
},
{
"name": "Storage"
},
{
"name": "Release"
},
{
"name": "Link"
},
{}
],
"rubricExpression": "\nall('Transformation','Storage','Release', 6);\nall('Transformation','Storage', 5);\nall('Transformation', 4);\nall('Source', 3);\nall('Link', 2);\nscore(1);\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment