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

Update information we get for sublevel of bubble choice in lesson plan #33147

Merged
merged 3 commits into from Feb 14, 2020

Conversation

dmcavoy
Copy link
Contributor

@dmcavoy dmcavoy commented Feb 14, 2020

Add some more data to the information we pull through for lesson plans such as icon, position, type, and letter.

Confirmed that is shows up correctly at a url like http://localhost-studio.code.org:3000/s/allthethings/stage/40/summary_for_lesson_plans

Example:

{"stageName":"Bubble Choice","lockable":false,"levels":[{"id":21375,"position":1,"named_level":false,"bonus_level":false,"assessment":null,"progression":null,"path":"/s/allthethings/stage/40/puzzle/1","display_name":"Bubble Choice: All the Choices","description":"This is a BubbleChoice level. Choose one of the activities below to practice what you have learned!","name":"allthethings_bubble_choice","type":"BubbleChoice","sublevels":[
{"level_id":13103,"type":"StandaloneVideo","name":"AllTheThings_StandaloneVideo","display_name":"AllTheThings_StandaloneVideo","video_youtube":"https://www.youtube-nocookie.com/embed/QvyTEx1wyOY/?autoplay=1\u0026enablejsapi=1\u0026iv_load_policy=3\u0026modestbranding=1\u0026rel=0\u0026showinfo=1\u0026v=QvyTEx1wyOY\u0026wmode=transparent","video_download":"https://videos.code.org/2015/csp/cs_is_changing_everything.mp4","id":13103,"description":"Want to watch a video instead of programming? This level is for you!","thumbnail_url":null,"position":1,"letter":"a","icon":"fa-video-camera","url":"http://localhost-studio.code.org:3000/levels/13103"},
{"level_id":21394,"type":"Weblab","name":"Web Lab 1","display_name":"MAKE A WEBPAGE","long_instructions":"Make an awesome web page!\r\n\r\n1. Look at the web page we gave you to start with. Look how lame it is. 1996 just called and wants its web page back. But don't get depressed - YOU can fix it!\r\n2. Add a background-color attribute in the body style in style.css to make the page background color 'darkcyan'\r\n3. Add a text-align attribute to the body style in style.css to center the image and text horizontally\r\n4. Change index.html to include an inspiring hashtag\r\n5. Add a color attribute to the p style in style.css to make the inspiring hashtag white\r\n6. Add a font-size attribute to the p style in style.css to make your inspiring hashtag REALLY BIG! (Try 24px and 3em and see what happens.)","mini_rubric":"false","id":21394,"description":"You can make a webpage on this one!","thumbnail_url":"https://images.code.org/78b6eb71df859b3e222c58458981f950-image-1567806072924.PNG","position":2,"letter":"b","icon":null,"url":"http://localhost-studio.code.org:3000/levels/21394"},
{"level_id":19060,"type":"Craft","name":"Overworld Chop Tree - allthethings","display_name":"Overworld Chop Tree - allthethings","short_instructions":"Wood is a very important resource. Many things are made from it. Walk to the tree and use the “destroy block” command to chop it down.","mini_rubric":"false","id":19060,"description":"Minecraft is all the rag right now!","thumbnail_url":"https://images.code.org/78b6eb71df859b3e222c58458981f950-image-1567806072924.PNG","position":3,"letter":"c","icon":null,"url":"http://localhost-studio.code.org:3000/levels/19060"},
{"level_id":29850,"type":"Multi","name":"K-1 Happy Maps Multi 1","display_name":"K-1 Happy Maps Multi 1","title":"Multiple Choice","questions":[{"text":"Which arrow gets the Flurb to the treasure?"}],"answers":[{"text":"/script_assets/k_1_images/unplugged_images/up.png","correct":false},{"text":"/script_assets/k_1_images/unplugged_images/down.png","correct":true},{"text":"/script_assets/k_1_images/unplugged_images/left.png","correct":false},{"text":"/script_assets/k_1_images/unplugged_images/right.png","correct":false}],"id":29850,"description":"Want to do some multiple choice? This level is for you!","thumbnail_url":null,"position":4,"letter":"d","icon":"fa fa-list-ul","url":"http://localhost-studio.code.org:3000/levels/29850"},
{"level_id":12691,"type":"Artist","name":"2-3 Artist 1 new","display_name":"2-3 Artist 1 new","short_instructions":"Hi, I'm an artist. You can write code to make me draw almost anything. Use a few blocks to make me draw over the grey lines in the picture. (Each line is 100 pixels long)","long_instructions":"Hi, I'm an artist. You can write code to make me draw almost anything. Use a few blocks to make me draw over the grey lines in the picture. (Each line is 100 pixels long)\r\n\r\n","mini_rubric":"false","video_youtube":"https://www.youtube-nocookie.com/embed/MUavAHn-QUg/?autoplay=1\u0026enablejsapi=1\u0026iv_load_policy=3\u0026modestbranding=1\u0026rel=0\u0026showinfo=1\u0026v=MUavAHn-QUg\u0026wmode=transparent","video_download":"http://videos.code.org/2014/C2-artist-intro.mp4","id":12691,"description":"Drawing with the artist can be really creative","thumbnail_url":null,"position":5,"letter":"e","icon":null,"url":"http://localhost-studio.code.org:3000/levels/12691"},
{"level_id":13100,"type":"Pixelation","name":"AllTheThings: Pixelation - Lesson 14 - Make the Letter A","display_name":"AllTheThings: Pixelation - Lesson 14 - Make the Letter A","short_instructions":"Make a 3x5 letter 'A'. The widget is setup with the incorrect dimensions. Your first task is to set the second byte to the 8-bit binary code for 5: 0000 0101. Then start entering pixel data.","long_instructions":"\u003cimg style=\"float:right; margin:0 20px\" src=\"https://code.org/images/cspunit1/letterA.png\" width=\"150\"\u003e\r\n            # Task 1: Make a 3x5 letter 'A'\r\n            Start by trying to recreate the 3x5 letter \"A\" depicted (at right) using the pixelation widget. \r\n          \r\n            The image is intially setup with the *incorrect* dimensions. Your first task is to set the second byte to the 8-bit binary code for 5: 0000 0101. Then you can start entering pixel data to make the A.\r\n            ","video_youtube":"https://www.youtube-nocookie.com/embed/rJOa5Q5a1WM/?autoplay=1\u0026enablejsapi=1\u0026iv_load_policy=3\u0026modestbranding=1\u0026rel=0\u0026showinfo=1\u0026v=rJOa5Q5a1WM\u0026wmode=transparent","video_download":"http://videos.code.org/2015/csp/pixelation_bw.mp4","id":13100,"description":"So many pixels to play with!","thumbnail_url":null,"position":6,"letter":"f","icon":null,"url":"http://localhost-studio.code.org:3000/levels/13100"},
{"level_id":20495,"type":"Applab","name":"U3L2 Using Simple Commands","display_name":"U3L2 Using Simple Commands","short_instructions":"Draw a 1x1 square above and to the left of the turtle's starting position. Click to see full instructions.","long_instructions":"\u003cimg src=\"https://images.code.org/0aca9e3ba0945f31ddd56438a45ed69c-image-1436286498758.png\" style=\"float:right\"\u003e\r\n\r\nGiven only 4 turtle commands, write code in App Lab to complete the drawings in each of the challenges below.  Your goal is to write code that solves the problem as efficiently as possible using only the commands provided.\r\n\r\nWhat does “efficient” mean?  In computer science it can actually mean several different things depending on what you’re talking about.  Work on these challenges, try to solve them in a way that you think is best and we’ll ask about efficiency at the end.\r\n\r\n\u003cimg src=\"https://images.code.org/d26ed114448c5ffe75a75ed761fab5f0-image-1447888033281.gif\" style=\"float:right\"\u003e\r\n\r\n# Do This: \r\nDraw a 1 x 1 square to the front and left of the turtle as efficiently as possible. The program should stop with turtle in its original position, facing its original direction.\r\n\r\nOnce you think you have a solution, click the Finish button - it will appear once you run the program.","teacher_markdown":"The constraint of working with only 4 commands is important. (See: “What’s the Point?” below.) If students come to the class with prior knowledge of programming they might try to go outside these constraints to reduce the number of lines of code.  \r\n\r\nIf you see students using commands beyond the 4 provided - or using parameters with those commands like: `moveForward(150)`, you should tell them that they are not solving the problem; the problem is to create the images using only the 4 commands provided.","mini_rubric":"false","video_youtube":"https://www.youtube-nocookie.com/embed/i2KHYUhtOlM/?autoplay=1\u0026enablejsapi=1\u0026iv_load_policy=3\u0026modestbranding=1\u0026rel=0\u0026showinfo=1\u0026v=i2KHYUhtOlM\u0026wmode=transparent","video_download":"https://videos.code.org/2015/csp/applab/turtle.mp4","id":20495,"description":"Do you like turtles? This is the level for you!","thumbnail_url":null,"position":7,"letter":"g","icon":null,"url":"http://localhost-studio.code.org:3000/levels/20495"},
{"level_id":19394,"type":"FreeResponse","name":"Sample Free Response","display_name":"Sample Free Response","title":"Submit a Lesson Plan: Routing and Packets","long_instructions":"In this module, you learned about how information gets shuttled from place-to-place on the internet, and the major steps along the way.  **Write a lesson plan for your students about how packets are constructed.**\r\n\r\n### How this task is reviewed\r\nThis task is peer-reviewed by 2 peers, using the following rubric:\r\n\r\n  - Lesson includes lecture\r\n  - Lesson includes activity on network simulator","id":19394,"description":"Want to write down some thoughts? Here you go!","thumbnail_url":null,"position":8,"letter":"h","icon":"fa fa-list-ul","url":"http://localhost-studio.code.org:3000/levels/19394"},{"level_id":21456,"type":"GamelabJr","name":"allthethings_fish_tank","display_name":"allthethings_fish_tank","long_instructions":"All-the-things test level.","mini_rubric":"false","id":21456,"description":"Fish! Make them swim!","thumbnail_url":null,"position":9,"letter":"i","icon":null,"url":"http://localhost-studio.code.org:3000/levels/21456"},
{"level_id":27942,"type":"Match","name":"K-1 Maze Match 1","display_name":"K-1 Maze Match 1","title":"Matching","questions":[{"text":"/script_assets/k_1_images/maze_images/maze_EN.png"},{"text":"/script_assets/k_1_images/maze_images/maze_ENE.png"},{"text":"/script_assets/k_1_images/maze_images/maze_WW.png"},{"text":"/script_assets/k_1_images/maze_images/maze_WSS.png"}],"answers":[{"text":"/script_assets/k_1_images/move_blocks/EN.png"},{"text":"/script_assets/k_1_images/move_blocks/ENE.png"},{"text":"/script_assets/k_1_images/move_blocks/WW.png"},{"text":"/script_assets/k_1_images/move_blocks/WSS.png"}],"id":27942,"description":"Match some stuff to some other stuff","thumbnail_url":null,"position":10,"letter":"j","icon":"fa fa-list-ul","url":"http://localhost-studio.code.org:3000/levels/27942"},
{"level_id":27365,"type":"External","name":"Test External Markdown","display_name":"Test External Markdown","title":"Test External Markdown","markdown":"## Testing External Markdown Rendering\n\nI am **bold**, _italic_, *other italic* and -strikethroughed-, and `code-y`.\n\n* Item `a`\n* Item `b`\n* Item `c`\n\n1. Item #1\n2. Item #2\n3. Item #3\n\n\u003cdetails\u003e\n\u003csummary id=\"summary-tag\"\u003eClick me to see a cool list\u003c/summary\u003e\nThis is bare text.\n\u003cp id=\"extra-details-tag\"\u003eI am in a p tag\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eThing 1\u003c/li\u003e\n\u003cli\u003eThing 2\u003c/li\u003e\n\u003cli\u003eThing 3\u003c/li\u003e\n\u003cli\u003eThing 4\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick me to see another cool thing\u003c/summary\u003e\nHi I am a second thing.\n\u003c/details\u003e\n\n### Embedded Blockly blocks\n\u003cxml\u003e\n  \u003cblock type=\"when_run\" deletable=\"false\" movable=\"false\"\u003e\n    \u003cnext\u003e\n      \u003cblock type=\"variables_set\"\u003e\n        \u003ctitle name=\"VAR\"\u003elength\u003c/title\u003e\n        \u003cvalue name=\"VALUE\"\u003e\n          \u003cblock type=\"math_number\"\u003e\n            \u003ctitle name=\"NUM\"\u003e50\u003c/title\u003e\n          \u003c/block\u003e\n        \u003c/value\u003e\n        \u003cnext\u003e\n          \u003cblock type=\"controls_repeat_ext\"\u003e\n            \u003cvalue name=\"TIMES\"\u003e\n              \u003cblock type=\"math_number\"\u003e\n                \u003ctitle name=\"NUM\"\u003e3\u003c/title\u003e\n              \u003c/block\u003e\n            \u003c/value\u003e\n            \u003cstatement name=\"DO\"\u003e\n              \u003cblock type=\"draw_move\" inline=\"true\"\u003e\n                \u003ctitle name=\"DIR\"\u003emoveForward\u003c/title\u003e\n                \u003cvalue name=\"VALUE\"\u003e\n                  \u003cblock type=\"variables_get\"\u003e\n                    \u003ctitle name=\"VAR\"\u003elength\u003c/title\u003e\n                  \u003c/block\u003e\n                \u003c/value\u003e\n                \u003cnext\u003e\n                  \u003cblock type=\"draw_turn\" inline=\"true\"\u003e\n                    \u003ctitle name=\"DIR\"\u003eturnLeft\u003c/title\u003e\n                    \u003cvalue name=\"VALUE\"\u003e\n                      \u003cblock type=\"math_number\" can_disconnect_from_parent=\"false\"\u003e\n                        \u003ctitle name=\"NUM\"\u003e120\u003c/title\u003e\n                      \u003c/block\u003e\n                    \u003c/value\u003e\n                  \u003c/block\u003e\n                \u003c/next\u003e\n              \u003c/block\u003e\n            \u003c/statement\u003e\n          \u003c/block\u003e\n        \u003c/next\u003e\n      \u003c/block\u003e\n    \u003c/next\u003e\n  \u003c/block\u003e\n\u003c/xml\u003e\n\n\u003ca class=\"btn btn-large btn-primary next-stage submitButton\"\u003eContinue\u003c/a\u003e\n","teacher_markdown":"This is some secret text for teachers only.\r\n","id":27365,"description":"Reading is cool. This level is for you","thumbnail_url":null,"position":11,"letter":"k","icon":"fa-file-text","url":"http://localhost-studio.code.org:3000/levels/27365"},
{"level_id":30603,"type":"LevelGroup","name":"Test longassessment levelgroup split new","display_name":"Test longassessment levelgroup split new","pages":[{"levels":["K-1 Happy Maps Multi 1","Multi Horizontal Scroll Test","Choose 2 Test"]},{"levels":["K-1 Plant a Seed Multi 1","K-1 Plant a Seed Multi 2","K-1 Artist 1 Multi 1","ECSPD1 computational thinker","ECSPD your goals_test"]},{"levels":["K-1 Maze Loops Multi 1","K-1 Maze Loops Multi 2"]}],"id":30603,"description":"Take a practice test!","thumbnail_url":null,"position":12,"letter":"l","icon":"fa fa-list-ul","url":"http://localhost-studio.code.org:3000/levels/30603"},{"level_id":21454,"type":"CurriculumReference","name":"allthethings_curriculum_reference","display_name":"allthethings_curriculum_reference","reference":"/docs/csd/maker_leds/index.html","id":21454,"description":"Wow getting more information on this subject would be neat.","thumbnail_url":null,"position":13,"letter":"m","icon":null,"url":"http://localhost-studio.code.org:3000/levels/21454"}],"teacher_markdown":"Teacher only markdown!"}]}

I also added a test for summary_for_lesson_plans

@dmcavoy dmcavoy changed the title Update information we get for sublevel of bubble choice Update information we get for sublevel of bubble choice in lesson plan Feb 14, 2020
description: level.try(:bubble_choice_description),
thumbnail_url: level.try(:thumbnail_url),
position: index + 1,
letter: alphabet[index],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't the position and letter always be correlated? Do we need both or just position that keys into a hash like { 1 : a, 2 : b ...} when the level is displayed. I don't feel strongly about this at all, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya I debated on finding a different way to do this but I'm worried about curriculum building wanting both for the template and it not being easy to parse inside the template so I went with this for now.

Copy link
Contributor

@Erin007 Erin007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for always including tests!

@dmcavoy dmcavoy merged commit 2d462ed into staging Feb 14, 2020
@dmcavoy dmcavoy deleted the update-bubble-choice-lesson-plan branch March 23, 2020 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants