diff --git a/_sources/turtles/SE_turtle/index.rst b/_sources/turtles/SE_turtle/index.rst new file mode 100644 index 00000000..ee53e572 --- /dev/null +++ b/_sources/turtles/SE_turtle/index.rst @@ -0,0 +1,49 @@ +Python 3 Turtles Practice +========================== + +Study Information +^^^^^^^^^^^^^^^^^^^^^^ + +Hi, we are a team of researchers in Professor Ericson’s Lab at UMSI. You are invited to participate in a study to help CS entry-level learning. +You must be at least 18 years old to participate into this study. Your participation will help more novice programmers become successful in introductory computing courses in a low-cost, scalable, and easily adopted way. + +This study has four parts. It will take approximately 40 minutes to complete it. +Please do the parts in order and answer questions to the best of your ability without any outside help including ChatGPT. +Please do the parts by yourself. You can stop working on a problem after you worked on it for about eight attempts without solving it. + +The four parts are: + +- **Know about your current state** - A survey about your self-efficacy on computer science + 4 self-evaluation survey questions. +- **Introduction to the Practice Types** - A brief overview of the practice types. +- **Practice** - Complete four mixed-up puzzle pairs, followed by survey questions. +- **Posttest** - Includes 10 multiple-choice / true-false / short-answer questions. + +Only your anonymous log fles from this session will be used for this study. No identifiable information will be collected. Participating in this study is completely voluntary. + +If you do not meet the eligibility criteria or if you choose to withdraw your consent and wish to have your **anonymous responses** deleted, please click to withdraw from the study. + +.. poll:: withdrawal + :option_1: I do not want to participate in this study. + +If you have questions at any time about the study or the procedures, you may contact the researcher at email xyhou@umich.edu. + +Click on the link at the end of each page to get to the next page. + + +What to do next +^^^^^^^^^^^^^^^^^^^^^^ +.. raw:: html + +

Click on the following link to take the pre-survey: Know more about your current state

+ +.. raw:: html + + diff --git a/_sources/turtles/SE_turtle/pp-intro-IE.rst b/_sources/turtles/SE_turtle/pp-intro-IE.rst new file mode 100644 index 00000000..a865cfc2 --- /dev/null +++ b/_sources/turtles/SE_turtle/pp-intro-IE.rst @@ -0,0 +1,133 @@ +Introduction to Practice Problem Types +====================================== + +Please read the following, watch the videos, and try to solve the problems. + + +πŸ’» Solve a mixed-up code problem +-------------------------------- + +If you see a problem like the one below you will need to put the mixed-up code in the correct order on the right side. +You may need to indent the blocks as well. There may also be extra blocks that are not +needed in a correct solution that you can leave on the left side. Click the "Check" button +to check your solution. + +See the video below for an example. + +.. youtube:: Rf7oWHlo-e0 + :divid: iwgex1-parsons1-ppie + :optional: + :width: 500 + :height: 415 + :align: center + +Try to solve the following mixed-up code problem. This problem doesn't require any indentation. + +.. parsonsprob:: intro-simple-parsons-ppie-1 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right. The text in each block + defines the order. + ----- + First block + ===== + Second block + ===== + Third block + +Try to solve the following mixed-up code problem. This problem requires indentation. + +.. parsonsprob:: intro-simple-parsons-ppie-2 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + The text in each block defines the order and indentation. + ----- + First block + ===== + Second block + ===== + Third block that needs to be indented + +Try to solve the following mixed-up code problem. This problem requires indentation and has extra blocks that are not needed in a correct solution. + +.. parsonsprob:: intro-simple-parsons-ppie-3 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + There is an extra block that is not needed in the correct solution. + ----- + First block + ===== + Second block + ===== + Extra block that is not needed #paired: This block is not needed + ===== + Third block that needs to be indented + +The mixed-up code problems have a "Help me" button at the bottom of the +problem. Once you have checked at least three incorrect solutions you can +click the button for help. It will remove an incorrect code block, if you used +one in your solution, or combine two blocks into one if there are more +than three blocks left. + +See the video below for an example. + +.. youtube:: QejZ7u642IU + :divid: iwgex1-parsons2-ppie + :optional: + :width: 500 + :height: 415 + :align: center + + +πŸ’» Receive an explanation of the solved puzzle +---------------------------------------------- + +After solving a mixed-up code problem, you can click on the following link to receive an explanation of the solved puzzle. An explanation will look like the following: + + +.. clickablearea:: introduction_IE + :question: Here is an explanation for the solution in the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + + Here is a completed function: + + + (1) Function Definition β€”β€” def joinStrings(str1, str2): + Defines a new function and takes two parameters as inputs: str1 and str2. Both parameters are string. + (2) Concatenate Strings β€”β€” joined = str1 + str2 + Creates a new variable called joined. It assigns to joined the result of concatenating str1 and str2 using the / operator. + This operation ensures that str1 comes before str2 in the resulting string. + (3) Return the Result β€”β€” return joined + This line returns the value stored in variable joined. + + +What to do next +^^^^^^^^^^^^^^^ + +.. raw:: html + +

Click on the following link to start the practice: Practice Problem

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pp-intro-PP.rst b/_sources/turtles/SE_turtle/pp-intro-PP.rst new file mode 100644 index 00000000..a9bf4db7 --- /dev/null +++ b/_sources/turtles/SE_turtle/pp-intro-PP.rst @@ -0,0 +1,112 @@ +Introduction to Practice Problem Types +====================================== + +Please read the following, watch the videos, and try to solve the problems. + + +πŸ’» Solve a mixed-up code problem +-------------------------------- + +If you see a problem like the one below you will need to put the mixed-up +code in the correct order on the right side. You +may need to indent the blocks as well. There may also be extra blocks that are not +needed in a correct solution that you can leave on the left side. Click the "Check" button +to check your solution. + +See the video below for an example. + +.. youtube:: Rf7oWHlo-e0 + :divid: iwgex1-parsons1-ppnse + :optional: + :width: 500 + :height: 415 + :align: center + +Try to solve the following mixed-up code problem. This problem doesn't require any indentation. + +.. parsonsprob:: intro-simple-parsons-ppnse-1 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right. The text in each block + defines the order. + ----- + First block + ===== + Second block + ===== + Third block + +Try to solve the following mixed-up code problem. This problem requires indentation. + +.. parsonsprob:: intro-simple-parsons-ppnse-2 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + The text in each block defines the order and indentation. + ----- + First block + ===== + Second block + ===== + Third block that needs to be indented + +Try to solve the following mixed-up code problem. This problem requires indentation and has extra blocks that are not needed in a correct solution. + +.. parsonsprob:: intro-simple-parsons-ppnse-3 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + There is an extra block that is not needed in the correct solution. + ----- + First block + ===== + Second block + ===== + Extra block that is not needed #paired: This block is not needed + ===== + Third block that needs to be indented + +The mixed-up code problems have a "Help me" button at the bottom of the +problem. Once you have checked at least three incorrect solutions you can +click the button for help. It will remove an incorrect code block, if you used +one in your solution, or combine two blocks into one if there are more +than three blocks left. + +See the video below for an example. + +.. youtube:: QejZ7u642IU + :divid: iwgex1-parsons2-ppnse + :optional: + :width: 500 + :height: 415 + :align: center + + + +What to do next +^^^^^^^^^^^^^^^ + +.. raw:: html + +

Click on the following link to start the practice: Practice Problem

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pp-intro-SE.rst b/_sources/turtles/SE_turtle/pp-intro-SE.rst new file mode 100644 index 00000000..80e773c6 --- /dev/null +++ b/_sources/turtles/SE_turtle/pp-intro-SE.rst @@ -0,0 +1,159 @@ +Introduction to Practice Problem Types +====================================== + +Please read the following, watch the videos, and try to solve the problems. + + +πŸ’» Solve a mixed-up code problem +-------------------------------- + +If you see a problem like the one below you will need to put the mixed-up +code in the correct order on the right side. You +may need to indent the blocks as well. There may also be extra blocks that are not +needed in a correct solution that you can leave on the left side. Click the "Check" button +to check your solution. + +See the video below for an example. + +.. youtube:: Rf7oWHlo-e0 + :divid: iwgex1-parsons1-ppse + :optional: + :width: 500 + :height: 415 + :align: center + +Try to solve the following mixed-up code problem. This problem doesn't require any indentation. + +.. parsonsprob:: intro-simple-parsons-ppse-1 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right. The text in each block + defines the order. + ----- + First block + ===== + Second block + ===== + Third block + +Try to solve the following mixed-up code problem. This problem requires indentation. + +.. parsonsprob:: intro-simple-parsons-ppse-2 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + The text in each block defines the order and indentation. + ----- + First block + ===== + Second block + ===== + Third block that needs to be indented + +Try to solve the following mixed-up code problem. This problem requires indentation and has extra blocks that are not needed in a correct solution. + +.. parsonsprob:: intro-simple-parsons-ppse-3 + :numbered: left + :adaptive: + :practice: T + :order: 3, 1, 2, 0 + + Drag the blocks from the left and put them in the correct order on the right with the correct indentation. + There is an extra block that is not needed in the correct solution. + ----- + First block + ===== + Second block + ===== + Extra block that is not needed #paired: This block is not needed + ===== + Third block that needs to be indented + +The mixed-up code problems have a "Help me" button at the bottom of the +problem. Once you have checked at least three incorrect solutions you can +click the button for help. It will remove an incorrect code block, if you used +one in your solution, or combine two blocks into one if there are more +than three blocks left. + +See the video below for an example. + +.. youtube:: QejZ7u642IU + :divid: iwgex1-parsons2-ppse + :optional: + :width: 500 + :height: 415 + :align: center + + + +πŸ’» Finish an explanation question +--------------------------------- + +If you see a problem like the one below, you will need to select the correct option from a list of options to answer the question. +The clicable area are those with a dark gray background and a border around them. Click on the correct option to select it. You can click on the option again to deselect it. +You will then receive a completed explanatoin of the solution you got from solving the mixed-up puzzle. + + + + + +Four types of feedback will be provided for each option you select. + +πŸ‘‰ Correct / Incorrect feedback + If you see a feedback message like "You are correct!" or "Incorrect.", it means you have selected the correct or incorrect option. + +πŸ‘‰ Detailed feedback on how many options you got correctly or incorrectly. + If you see a feedback message like "You clicked on 1 of the 2 correct elements and 0 of the 3 incorrect elements.", it tells you the number of correct and incorrect options you selected. + +πŸ‘‰ Hints on how to correct the incorrectly selected options. + If you see a feedback message like "Think about the type of the input parameter.", it provides hints on how to correct the incorrect options you selected. + +πŸ‘‰ Highlighted incorrectly selected options + The Incorrect options you selected will be highlighted in pink background with a red border. You need to deselect the incorrect options and select the correct options. + + +Try to solve the following explanation problem. You can click on the options to select them and see feedback. + +.. clickablearea:: introduction_MSE + :question: Complete the following sections to provide an explanation for the solution in the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: (1) Think about the type of the input parameter. (2) Think about the operator used to concatenate two strings. + + Here is a completed function: + + + (1) Function Definition β€”β€” def joinStrings(str1, str2): + Defines a new function and takes two parameters as inputs: str1 and str2. Both parameters are [:click-correct:string:endclick: / :click-incorrect:list:endclick:]. + (2) Concatenate Strings β€”β€” joined = str1 + str2 + Creates a new variable called joined. It assigns to joined the result of concatenating str1 and str2 using the [:click-correct:+:endclick: or :click-incorrect:&&:endclick: or :click-incorrect:%:endclick:] operator. + This operation ensures that str1 comes before str2 in the resulting string. + (3) Return the Result β€”β€” return joined + This line returns the value stored in variable joined. + + + +What to do next +^^^^^^^^^^^^^^^ + +.. raw:: html + +

Click on the following link to start the practice: Practice Problem

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-IE-pp1.rst b/_sources/turtles/SE_turtle/pps-IE-pp1.rst new file mode 100644 index 00000000..44f0f04d --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-IE-pp1.rst @@ -0,0 +1,82 @@ +Practice Problems +================= + +.. parsonsprob:: PP_IE_tutles_1 + :numbered: left + :adaptive: + + Create a function called ``create_T`` that takes in ``turtle`` as a parameter and moves the turtle to create the letter T. + The width of the letter should be 100, and the height of the letter should be 150. + ----- + from turtle import * + ===== + def create_T(turtle_obj): + ===== + width = 100 + height = 150 + ===== + turtle_obj.penup() + turtle_obj.goto(-width / 2, height / 2) + turtle_obj.pendown() + ===== + turtle_obj.forward(width) + ===== + turtle_obj.backward(width / 2) + ===== + turtle_obj.backward(width % 2) #paired + ===== + turtle_obj.right(90) + ===== + turtle_obj.forward(height) + + + +.. raw:: html + +

Click on the following link to go to the explanation: Explanation

+ + +.. raw:: html + + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-IE-pp2.rst b/_sources/turtles/SE_turtle/pps-IE-pp2.rst new file mode 100644 index 00000000..c9b90151 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-IE-pp2.rst @@ -0,0 +1,77 @@ +Practice Problems +================= + +.. parsonsprob:: PP_IE_tutles_2 + :numbered: left + :adaptive: + :practice: T + + Create a function called ``create_hexagon`` that takes in ``turtle`` as a parameter and moves the ``turtle`` to create a hexagon. + Each side of the hexagon should be of length 50. Create a Screen object and a Turtle object first. After creating the function, call ``create_hexagon``. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def create_hexagon(turtle): + ===== + for i in range(0, 6): + ===== + turtle.forward(50) + ===== + turtle = turtle.forward(50) #paired + ===== + turtle.left(60) + ===== + turtle = turtle.left(60) #paired + ===== + create_hexagon(alex) + +.. raw:: html + +

Click on the following link to go to the explanation: Explanation

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-IE-pp3.rst b/_sources/turtles/SE_turtle/pps-IE-pp3.rst new file mode 100644 index 00000000..5ea278ba --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-IE-pp3.rst @@ -0,0 +1,82 @@ +Practice Problems +================= + +.. parsonsprob:: PP_IE_tutles_3 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_triangle`` that takes in parameters ``turtle``, ``length``, and ``three_colors_list`` and moves the ``turtle`` + to create a triangle with side lengths of ``length`` and in which the pen color changes for each side. Create a Screen object and a Turtle object first. + After creating the function, call ``draw_triangle`` with arguments ``length = 50``, ``three_colors_list = ["blue", "green", "yellow"]``, and the Turtle object. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def draw_triangle(turtle, length, three_colors_list): + ===== + for color in three_colors_list: + ===== + for i in range(3): #paired + ===== + turtle.color(color) + ===== + turtle.side(three_colors_list[i]) #paired + ===== + turtle.forward(length) + ===== + turtle.right(120) + ===== + draw_triangle(alex, 50, ["blue", "green", "yellow"]) + + + +.. raw:: html + +

Click on the following link to go to the explanation: Explanation

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-IE-pp4.rst b/_sources/turtles/SE_turtle/pps-IE-pp4.rst new file mode 100644 index 00000000..084a5a51 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-IE-pp4.rst @@ -0,0 +1,83 @@ +Practice Problems +================= + +.. parsonsprob:: PP_IE_tutles_4 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_diamond`` that takes in parameters ``turtle``, ``xpos``, ``ypos``, ``length``, and ``color`` and creates a diamond + at any given position with color ``color`` and side lengths of ``length``. + ----- + from turtle import * + def draw_diamond(turtle, xpos, ypos, length, color): + ===== + turtle.penup() + turtle.goto(xpos, ypos) + ===== + turtle.left(45) + ===== + turtle.left(90) #paired + ===== + turtle.pendown() + ===== + turtle.color(color) + ===== + turtle.side(color) #paired + ===== + turtle.begin_fill() + ===== + for i in range(4): + turtle.forward(length) + turtle.left(90) + ===== + turtle.end_fill() + +.. raw:: html + +

Click on the following link to go to the explanation: Explanation

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-PP-1.rst b/_sources/turtles/SE_turtle/pps-PP-1.rst new file mode 100644 index 00000000..c53cc2a7 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-PP-1.rst @@ -0,0 +1,83 @@ +Practice Problems +================= + +.. parsonsprob:: PP_NSE_tutles_1 + :numbered: left + :adaptive: + + Create a function called ``create_T`` that takes in ``turtle`` as a parameter and moves the turtle to create the letter T. + The width of the letter should be 100, and the height of the letter should be 150. + ----- + from turtle import * + ===== + def create_T(turtle_obj): + ===== + width = 100 + height = 150 + ===== + turtle_obj.penup() + turtle_obj.goto(-width / 2, height / 2) + turtle_obj.pendown() + ===== + turtle_obj.forward(width) + ===== + turtle_obj.backward(width / 2) + ===== + turtle_obj.backward(width % 2) #paired + ===== + turtle_obj.right(90) + ===== + turtle_obj.forward(height) + + + +.. raw:: html + +

Click on the following link to go to the next puzzle: Mixed-up Puzzle 2

+ + +.. raw:: html + + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-PP-2.rst b/_sources/turtles/SE_turtle/pps-PP-2.rst new file mode 100644 index 00000000..1161d0c4 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-PP-2.rst @@ -0,0 +1,79 @@ +Practice Problems +================= + +.. parsonsprob:: PP_NSE_tutles_2 + :numbered: left + :adaptive: + :practice: T + + Create a function called ``create_hexagon`` that takes in ``turtle`` as a parameter and moves the ``turtle`` to create a hexagon. + Each side of the hexagon should be of length 50. Create a Screen object and a Turtle object first. After creating the function, call ``create_hexagon``. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def create_hexagon(turtle_obj): + ===== + for i in range(0, 6): + ===== + for i in range(0, 7): #paired + ===== + turtle_obj.forward(50) + ===== + turtle_obj = turtle_obj.forward(50) #paired + ===== + turtle_obj.left(60) + ===== + create_hexagon(alex) + + + +.. raw:: html + +

Click on the following link to go to the explanation question: Mixed-up Puzzle 3

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-PP-3.rst b/_sources/turtles/SE_turtle/pps-PP-3.rst new file mode 100644 index 00000000..064896f9 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-PP-3.rst @@ -0,0 +1,82 @@ +Practice Problems +================= + +.. parsonsprob:: PP_NSE_tutles_3 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_triangle`` that takes in parameters ``turtle``, ``length``, and ``three_colors_list`` and moves the ``turtle`` + to create a triangle with side lengths of ``length`` and in which the pen color changes for each side. Create a Screen object and a Turtle object first. + After creating the function, call ``draw_triangle`` with arguments ``length = 50``, ``three_colors_list = ["blue", "green", "yellow"]``, and the Turtle object. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def draw_triangle(turtle_obj, length, three_colors_list): + ===== + for color in three_colors_list: + ===== + for i in range(3): #paired + ===== + turtle_obj.color(color) + ===== + turtle_obj.side(three_colors_list[i]) #paired + ===== + turtle_obj.forward(length) + ===== + turtle_obj.right(120) + ===== + draw_triangle(alex, 50, ["blue", "green", "yellow"]) + + + +.. raw:: html + +

Click on the following link to go to the explanation question: Mixed-up Puzzle 4

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-PP-4.rst b/_sources/turtles/SE_turtle/pps-PP-4.rst new file mode 100644 index 00000000..eb6665c4 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-PP-4.rst @@ -0,0 +1,83 @@ +Practice Problems +================= + +.. parsonsprob:: PP_NSE_tutles_4 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_diamond`` that takes in parameters ``turtle``, ``xpos``, ``ypos``, ``length``, and ``color`` and creates a diamond + at any given position with color ``color`` and side lengths of ``length``. + ----- + from turtle import * + def draw_diamond(turtle, xpos, ypos, length, color): + ===== + turtle.penup() + turtle.goto(xpos, ypos) + ===== + turtle.left(45) + ===== + turtle.left(90) #paired + ===== + turtle.pendown() + ===== + turtle.color(color) + ===== + turtle.side(color) #paired + ===== + turtle.begin_fill() + ===== + for i in range(4): + turtle.forward(length) + turtle.left(90) + ===== + turtle.end_fill() + +.. raw:: html + +

Click on the following link to finish the posttest: Posttest

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-SE-pp1.rst b/_sources/turtles/SE_turtle/pps-SE-pp1.rst new file mode 100644 index 00000000..ccf4dccf --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-SE-pp1.rst @@ -0,0 +1,83 @@ +Practice Problems +================= + +.. parsonsprob:: PP_SE_tutles_1 + :numbered: left + :adaptive: + + Create a function called ``create_T`` that takes in ``turtle`` as a parameter and moves the turtle to create the letter T. + The width of the letter should be 100, and the height of the letter should be 150. + ----- + from turtle import * + ===== + def create_T(turtle_obj): + ===== + width = 100 + height = 150 + ===== + turtle_obj.penup() + turtle_obj.goto(-width / 2, height / 2) + turtle_obj.pendown() + ===== + turtle_obj.forward(width) + ===== + turtle_obj.backward(width / 2) + ===== + turtle_obj.backward(width % 2) #paired + ===== + turtle_obj.right(90) + ===== + turtle_obj.forward(height) + + + + +.. raw:: html + +

Click on the following link to go to the explanation question: Explanation Question

+ + +.. raw:: html + + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-SE-pp2.rst b/_sources/turtles/SE_turtle/pps-SE-pp2.rst new file mode 100644 index 00000000..08ee8252 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-SE-pp2.rst @@ -0,0 +1,77 @@ +Practice Problems +================= + +.. parsonsprob:: PP_SE_tutles_2 + :numbered: left + :adaptive: + :practice: T + + Create a function called ``create_hexagon`` that takes in ``turtle`` as a parameter and moves the ``turtle`` to create a hexagon. + Each side of the hexagon should be of length 50. Create a Screen object and a Turtle object first. After creating the function, call ``create_hexagon``. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def create_hexagon(turtle): + ===== + for i in range(0, 6): + ===== + turtle.forward(50) + ===== + turtle = turtle.forward(50) #paired + ===== + turtle.left(60) + ===== + turtle = turtle.left(60) #paired + ===== + create_hexagon(alex) + +.. raw:: html + +

Click on the following link to go to the explanation question: Explanation Question

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-SE-pp3.rst b/_sources/turtles/SE_turtle/pps-SE-pp3.rst new file mode 100644 index 00000000..cc032c08 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-SE-pp3.rst @@ -0,0 +1,82 @@ +Practice Problems +================= + +.. parsonsprob:: PP_SE_tutles_3 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_triangle`` that takes in parameters ``turtle``, ``length``, and ``three_colors_list`` and moves the ``turtle`` + to create a triangle with side lengths of ``length`` and in which the pen color changes for each side. Create a Screen object and a Turtle object first. + After creating the function, call ``draw_triangle`` with arguments ``length = 50``, ``three_colors_list = ["blue", "green", "yellow"]``, and the Turtle object. + ----- + from turtle import * + space = Screen() + alex = Turtle() + ===== + def draw_triangle(turtle, length, three_colors_list): + ===== + for color in three_colors_list: + ===== + for i in range(3): #paired + ===== + turtle.color(color) + ===== + turtle.side(three_colors_list[i]) #paired + ===== + turtle.forward(length) + ===== + turtle.right(120) + ===== + draw_triangle(alex, 50, ["blue", "green", "yellow"]) + + + +.. raw:: html + +

Click on the following link to go to the explanation question: Explanation Question

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-SE-pp4.rst b/_sources/turtles/SE_turtle/pps-SE-pp4.rst new file mode 100644 index 00000000..75aa1dc5 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-SE-pp4.rst @@ -0,0 +1,84 @@ +Practice Problems +================= + +.. parsonsprob:: PP_SE_tutles_4 + :numbered: left + :practice: T + :adaptive: + + Create a function called ``draw_diamond`` that takes in parameters ``turtle``, ``xpos``, ``ypos``, ``length``, and ``color`` and creates a diamond + at any given position with color ``color`` and side lengths of ``length``. + ----- + from turtle import * + def draw_diamond(turtle, xpos, ypos, length, color): + ===== + turtle.penup() + turtle.goto(xpos, ypos) + ===== + turtle.left(45) + ===== + turtle.left(90) #paired + ===== + turtle.pendown() + ===== + turtle.color(color) + ===== + turtle.side(color) #paired + ===== + turtle.begin_fill() + ===== + for i in range(4): + turtle.forward(length) + turtle.left(90) + ===== + turtle.end_fill() + + +.. raw:: html + +

Click on the following link to go to the explanation question: Explanation Question

+ + +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-ie1.rst b/_sources/turtles/SE_turtle/pps-ie1.rst new file mode 100644 index 00000000..549ca0d8 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ie1.rst @@ -0,0 +1,72 @@ +Here is an explanation for the completed puzzle +================================================ + +.. clickablearea:: IE_tutles_1 + :question: An explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) def create_T(turtle_obj): -- Define Function + Creates a function create_T that takes turtle_obj as an argument to draw the letter T. + (3) width = 100 -- Set Width + Sets the variable width to 100, which represents the width of the letter T. + (4) height = 150 -- Set Height + Sets the variable height to 150, which represents the height of the letter T. + (5) turtle_obj.penup() -- Lift Pen + Use .penup() to lift the turtle's pen to move it without drawing. + (6) turtle_obj.goto(-width / 2, height / 2) -- Move to Start Position + Moves the turtle to the starting position at the top-left part of the T. + -width / 2: Moves the turtle half the width to the left of the origin (center of the screen). This ensures the horizontal line of the T is centered horizontally. + height / 2: Moves the turtle to half the height upwards from the origin. This places the turtle at the highest point needed to start drawing the letter T. + The goto function thus moves the turtle to the point (-50, 75), which is the left end of the top horizontal line of the T. + (7) turtle_obj.pendown() -- Lower Pen + Use .pendown() to lower the turtle's pen to start drawing. + (8) turtle_obj.forward(width) -- Draw Top Horizontal Line + Moves the turtle forward by the value of width to draw the top horizontal line of the T. + (9) turtle_obj.backward(width / 2) -- Move to Middle + Use / to perform standard division and returns the quotient as a floating-point number. Operator % performs division and returns the [:click-incorrect:quotient:endclick: / :click-correct:reminder:endclick:] of that division. + Moves the turtle backward by half the width to the middle of the top horizontal line. + (10) turtle_obj.right(90) -- Turn Right + Rotates the turtle 90 degrees to the clockwise(right) to prepare for drawing the vertical line. + (11) turtle_obj.forward(height) -- Draw Vertical Line + Moves the turtle forward by the value of height to draw the vertical line of the T. + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 2

+ +.. .. raw:: html + +.. diff --git a/_sources/turtles/SE_turtle/pps-ie2.rst b/_sources/turtles/SE_turtle/pps-ie2.rst new file mode 100644 index 00000000..0ab2b9ed --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ie2.rst @@ -0,0 +1,67 @@ +Here is an explanation for the completed puzzle +================================================ + +.. clickablearea:: IE_tutles_2 + :question: An explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) space = Screen() -- Screen Initialization + Initializes a Screen() object named space. This object creates a window where the turtle graphics will be displayed. + (3) alex = Turtle() -- Turtle Initialization + Initializes a Turtle object named alex using Turtle(). alex is a variable used to store an instance of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def create_hexagon(turtle): -- Hexagon Function Definition + Defines a function called create_hexagon that takes a Turtle object (turtle) as an argument. + (5) for i in range(0, 6): -- Loop for Hexagon Sides + Initializes a loop that will iterate 6 times, corresponding to the 6 sides of a hexagon. + The range(0, 6) function generates a sequence of numbers starting from 0 and stopping before 6 (i.e., 0, 1, 2, 3, 4, 5). + (6) turtle.forward(50) -- Draw One Side + During each iteration, the Turtle object moves forward by 50 units, drawing one side of the hexagon. + (7) turtle.left(60) -- Turn for Next Side + The turtle.left(angle) rotates the turtle counterclockwise(left) by the specified angle in degrees + After drawing each side, the Turtle object turns 60 degrees to the left, setting up the correct angle for the next side of the hexagon. + (8) create_hexagon(alex) -- Call Hexagon Function + Calls the create_hexagon function, passing the Turtle object alex as an argument. This initiates the drawing of the hexagon. + + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 3

+ +.. .. raw:: html + +.. \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-ie3.rst b/_sources/turtles/SE_turtle/pps-ie3.rst new file mode 100644 index 00000000..f787d365 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ie3.rst @@ -0,0 +1,68 @@ +Here is an explanation for the completed puzzle +================================================ + +.. clickablearea:: IE_tutles_3 + :question: An explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) space = Screen() -- Screen Initialization + Initializes a Screen() object named space. This object creates a window where the turtle graphics will be displayed. + (3) alex = Turtle() -- Turtle Initialization + Initializes a Turtle object named alex using Turtle(). alex is a variable used to store an instance of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def draw_triangle(turtle, length, three_colors_list): -- Function Definition + Defines a function called draw_triangle that takes in a turtle object, the length of the triangle sides, and a list of three colors. + (5) for i in range(3): -- Loop for Three Sides + Sets up a loop to iterate three times (i.e., 0, 1, 2), once for each side of the triangle. + i will take on values 0, 1, and 2 in successive iterations. + (6) turtle.color(three_colors_list[i]) -- Set Pen Color + By iterating over the index 0 to 2, the loop variable i is used to access each color in three_colors_list. + Each three_colors_list[i] access the current color in the list and change the pen color of the turtle to that color. + (7) turtle.forward(length) -- Draw Side + Moves the turtle forward by the specified length to draw a side of the triangle. + (8) turtle.right(120) -- Turn Turtle to the right + Rotates the turtle to the right by a 120 degrees. + This determines the direction the turtle will face for the next iteration. + (9) draw_triangle(alex, 50, ["blue", "green", "yellow"]) -- Call Function + Calls the draw_triangle function with the specified turtle object, side length, and list of colors to draw an equilateral triangle. + + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 4

+ +.. .. raw:: html + +.. \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-ie4.rst b/_sources/turtles/SE_turtle/pps-ie4.rst new file mode 100644 index 00000000..fd8362d5 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ie4.rst @@ -0,0 +1,72 @@ +Here is an explanation for the completed puzzle +================================================ + +.. clickablearea:: IE_tutles_4 + :question: An explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) def draw_diamond(turtle, xpos, ypos, length, color): -- Function Definition + Defines a function named draw_diamond that takes five parameters: turtle (a Turtle object), xpos and ypos (coordinates for position), length (side length of the diamond), and color (color of the diamond). + (3) turtle.penup() -- Lift Pen Up + Lifts the turtle's pen so that it does now draw while moving to the start position. + (4) turtle.goto(xpos, ypos) -- Move to Start Position + Use .goto() to move the turtle to the specified (xpos, ypos) coordinates. + (5) turtle.left(45) -- Rotate for Diamond Orientation + Rotates the turtle left by 45 degrees to orient it for drawing the diamond. + (6) turtle.pendown() -- Lower Pen Down + Lowers the pen so that the turtle will start drawing when it moves. + (7) turtle.color(color) -- Set Pen Color + Sets the color of the turtle’s pen to the specified color stored in the variable color. + (8) turtle.begin_fill() -- Start Filling a Shape with a Color + Use .begin_fill() to start the filling process, so the shape will be filled with the specified color when completed. + (9) for i in range(4): -- A Loop to Draw the Outline of the Diamond + Starts a loop that will iterate four times to draw the four sides of the diamond. + (10) turtle.forward(length) -- Move Forward to Draw the Outline of the Shape + Moves the turtle forward by the specified length to draw one side of the diamond. + (11) turtle.left(90) -- Turn 90 Degrees Left + Turns the turtle left by 90 degrees to prepare for drawing the next side. + (12) turtle.end_fill() -- End Filling the Shape with the Color + Use .end_fill() to end the filling process, completing the filled shape with the specified color. + + +.. raw:: html + +

Click on the following link to finish the posttest: Posttest

+ +.. .. raw:: html + +.. \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-posttest.rst b/_sources/turtles/SE_turtle/pps-posttest.rst new file mode 100644 index 00000000..b9690d16 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-posttest.rst @@ -0,0 +1,195 @@ +Turtle Posttest Problem +^^^^^^^^^^^^^^^^^^^^^^^^ + +* πŸ’» Please complete the problems below independently without any outside help, including AI tools like ChatGPT. + +* Again, you can stop working on a problem after you worked on it for about two minutes without solving it. + + +.. timed:: timed_posttest + :timelimit: 15 + + .. poll:: SE_posttest_tf_1 + :option_1: True + :option_2: False + + True or False: In the turtle module, the method penup() is used to resume drawing when the turtle moves. + + + + .. poll:: SE_posttest_tf_2 + :option_1: True + :option_2: False + + True or False: The color() method in the turtle module is used to change the background color of the graphics window. + + + + .. poll:: SE_posttest_mcq_3 + :option_1: Turtle is a variable, and alex is an instance of the class. + :option_2: Turtle is a class, and alex is a variable used to store an instance of the Turtle class. + :option_3: Turtle is a class, and alex is a method used to initialize it. + :option_4: Turtle is a variable, and alex is a class used to create a new object. + :option_5: Turtle is a instance, and alex is a method used to initialize it. + + + One correct option MCQ: In the statement alex = Turtle(), what role do the term Turtle and alex play? + + + + .. poll:: SE_posttest_mcq_4 + :option_1: for i in range(4): + :option_2: for i in range(5): + :option_3: for i in range(7): + :option_4: for i in range(6): + + One correct option MCQ: Which option represents the same number of iterations as the loop in the following code snippet? +
+ for i in range(1, 7): + + + .. poll:: SE_posttest_mcq_5 + :option_1: A + :option_2: B + :option_3: C + :option_4: D + :option_5: E + + One correct option MCQ: What is the output of the following code snippet? +
+ .. image:: https://i.postimg.cc/7YSbRQKs/SE-posttest-mcq-5.png + + + .. mchoice:: SE_posttest_mcq_6 + :multiple_answers: + + Select all that apply: The following code snippet produces one or more errors. + + ``from turtle import all`` + + ``Turtle()`` + + ``t = t.color("blue")`` + + - The turtle module is not imported correctly. + + + Thank you for answering the question. + + - Turtle() needs to be assigned to a variable. + + + Thank you for answering the question. + + - The color method does not exist. + + + Thank you for answering the question. + + - The third line should call color() method without trying to assign it to a value. + + + Thank you for answering the question. + + - The t.color() method should not be used with an argument, such as "blue". + + + Thank you for answering the question. + + + + .. mchoice:: SE_posttest_mcq_7 + :multiple_answers: + + Select all that apply: Which of the following statements are true regarding the differences and similarities between the two loops? + + .. image:: https://i.postimg.cc/4yCs9L3h/SE-posttest-mcq-6.png + + - The ``for i in range(5)`` loop iterates a fixed number of times, specifically 5 times. + + + Thank you for answering the question. + + - The ``for item in item_list`` loop modifies the original list elements during iteration. + + + Thank you for answering the question. + + - Both loops can be used to iterate over a sequence of numbers. + + + Thank you for answering the question. + + - Both code snippets will print out the same sequence of numbers. + + + Thank you for answering the question. + + + + .. mchoice:: SE_posttest_mcq_8 + :multiple_answers: + + **Select all that apply:** Which of the following statements are true regarding the ``t.left(90)`` line in the code? + + ``import turtle`` + + ``t = turtle.Turtle()`` + + ``t.left(90)`` + + + - The turtle turns 90 degrees to the right. + + + Thank you for answering the question. + + - The turtle turns 90 degrees to the left. + + + Thank you for answering the question. + + - The turtle makes a circle. + + + Thank you for answering the question. + + - The turtle's orientation changes, but it doesn't move from its current position. + + + Thank you for answering the question. + + - The turtle turns 180 degrees to the left. + + + Thank you for answering the question. + + + + + .. mchoice:: SE_posttest_mcq_9 + :multiple_answers: + + **Select all that apply:** All code statements that will draw a **rectangle** using the turtle module in Python: + + .. image:: https://i.postimg.cc/L8JL95GQ/SE-posttest-mcq-9.png + + - A + + + Thank you for answering the question. + + - B + + + Thank you for answering the question. + + - C + + + Thank you for answering the question. + + - D + + + Thank you for answering the question. + + + + .. shortanswer:: SE_posttest_sa_10 + + What is the purpose of the following line of code in the turtle module? + + ``t.goto(100, 100)`` + +.. shortanswer:: SE_opinion + + What did you think of the practice problems in this study? Please provide any feedback or suggestions for improvement. + +πŸ™Œ Thank You! +============================ +Thank you for taking part in this study! We appreciate your time on this. + + diff --git a/_sources/turtles/SE_turtle/pps-ppe1.rst b/_sources/turtles/SE_turtle/pps-ppe1.rst new file mode 100644 index 00000000..035f592b --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ppe1.rst @@ -0,0 +1,72 @@ +Complete the following sections to get an explanation for the completed puzzle +============================================================================== + +.. clickablearea:: SE_tutles_1 + :question: Complete the following sections to get an explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use [:click-correct:import *:endclick: / :click-incorrect:import all:endclick: / :click-incorrect:Import All:endclick:] to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) def create_T(turtle_obj): -- Define Function + Creates a function create_T that takes turtle_obj as an argument to draw the letter T. + (3) width = 100 -- Set Width + Sets the variable width to 100, which represents the width of the letter T. + (4) height = 150 -- Set Height + Sets the variable height to 150, which represents the height of the letter T. + (5) turtle_obj.penup() -- Lift Pen + Use .penup() to [:click-incorrect:lower:endclick: / :click-correct:lift:endclick:] the turtle's pen to move it without drawing. + (6) turtle_obj.goto(-width / 2, height / 2) -- Move to Start Position + Moves the turtle to the starting position at the top-left part of the T. + -width / 2: Moves the turtle half the width to the [:click-incorrect:right:endclick: / :click-correct:left:endclick:] of the origin (center of the screen). This ensures the horizontal line of the T is centered horizontally. + height / 2: Moves the turtle to half the height [:click-incorrect:downwards:endclick: / :click-correct:upwards:endclick:] from the origin. This places the turtle at the highest point needed to start drawing the letter T. + The goto function thus moves the turtle to the point (-50, 75), which is the left end of the top horizontal line of the T. + (7) turtle_obj.pendown() -- Lower Pen + Use .pendown() to [:click-correct:lower:endclick: / :click-incorrect:lift:endclick:] the turtle's pen to start drawing. + (8) turtle_obj.forward(width) -- Draw Top Horizontal Line + Moves the turtle [:click-incorrect:backward:endclick: / :click-correct:forward:endclick:] by the value of width to draw the top horizontal line of the T. + (9) turtle_obj.backward(width / 2) -- Move to Middle + Use / to perform standard division and returns the quotient as a floating-point number. Operator % performs division and returns the [:click-incorrect:quotient:endclick: / :click-correct:reminder:endclick:] of that division. + Moves the turtle backward by half the width to the middle of the top horizontal line. + (10) turtle_obj.right(90) -- Turn Right + Rotates the turtle 90 degrees to the [:click-incorrect:counterclockwise(left):endclick: / :click-correct:clockwise(right):endclick:] to prepare for drawing the vertical line. + (11) turtle_obj.forward(height) -- Draw Vertical Line + Moves the turtle forward by the value of height to draw the vertical line of the T. + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 2

+ +.. raw:: html + + diff --git a/_sources/turtles/SE_turtle/pps-ppe2.rst b/_sources/turtles/SE_turtle/pps-ppe2.rst new file mode 100644 index 00000000..aace43f3 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ppe2.rst @@ -0,0 +1,67 @@ +Complete the following sections to get an explanation for the completed puzzle +============================================================================== + +.. clickablearea:: SE_tutles_2 + :question: Complete the following sections to get an explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use [:click-correct:import *:endclick: / :click-incorrect:import all:endclick: / :click-incorrect:Import All:endclick:] to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) space = Screen() -- Screen Initialization + Initializes a [:click-correct:Screen():endclick: / :click-incorrect:screen():endclick:] object named space. This object creates a window where the turtle graphics will be displayed. + (3) alex = Turtle() -- Turtle Initialization + Initializes a Turtle object named alex using Turtle(). alex is a [:click-correct:variable:endclick: / :click-incorrect:method:endclick:] used to store an instance of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def create_hexagon(turtle): -- Hexagon Function Definition + Defines a function called create_hexagon that takes a Turtle object (turtle) as an argument. + (5) for i in range(0, 6): -- Loop for Hexagon Sides + Initializes a loop that will iterate 6 times, corresponding to the 6 sides of a hexagon. + The range(0, 6) function generates a sequence of numbers starting from [:click-correct:0:endclick: / :click-incorrect:1:endclick:] and stopping before 6 (i.e., 0, 1, 2, 3, 4, 5). + (6) turtle.forward(50) -- Draw One Side + During each iteration, the Turtle object moves [:click-correct:forward:endclick: / :click-incorrect:backward:endclick:] by 50 units, drawing one side of the hexagon. + (7) turtle.left(60) -- Turn for Next Side + The turtle.left(angle) rotates the turtle [:click-correct:counterclockwise(left):endclick: / :click-incorrect:clockwise(right):endclick:] by the specified angle in degrees + After drawing each side, the Turtle object turns 60 degrees to the left, setting up the correct angle for the next side of the hexagon. + (8) create_hexagon(alex) -- Call Hexagon Function + Calls the create_hexagon function, passing the Turtle object alex as an argument. This initiates the drawing of the hexagon. + + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 3

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-ppe3.rst b/_sources/turtles/SE_turtle/pps-ppe3.rst new file mode 100644 index 00000000..c8bf2a48 --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ppe3.rst @@ -0,0 +1,68 @@ +Complete the following sections to get an explanation for the completed puzzle +============================================================================== + +.. clickablearea:: SE_tutles_3 + :question: Complete the following sections to get an explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) space = Screen() -- Screen Initialization + Initializes a Screen() object named space. This object creates a window where the turtle graphics will be displayed. + (3) alex = Turtle() -- Turtle Initialization + Initializes a Turtle object named alex using Turtle(). alex is a [:click-correct:variable:endclick: / :click-incorrect:method:endclick:] used to store an instance of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def draw_triangle(turtle, length, three_colors_list): -- Function Definition + Defines a function called draw_triangle that takes in a turtle object, the length of the triangle sides, and a [:click-correct:list:endclick: / :click-incorrect:dictionary:endclick:] of three colors. + (5) for i in range(3): -- Loop for Three Sides + Sets up a loop to iterate [:click-correct:three:endclick: / :click-incorrect:four:endclick:] times (i.e., 0, 1, 2), once for each side of the triangle. + i will take on values 0, 1, and 2 in successive iterations. + (6) turtle.color(three_colors_list[i]) -- Set Pen Color + By iterating over the index 0 to 2, the loop variable i is used to access each color in three_colors_list. + Each three_colors_list[i] access the [:click-correct:current:endclick: / :click-incorrect:previous:endclick:] color in the list and change the pen color of the turtle to that color. + (7) turtle.forward(length) -- Draw Side + Moves the turtle forward by the specified length to draw a side of the triangle. + (8) turtle.right(120) -- Turn Turtle to the right + Rotates the turtle to the [:click-correct:right:endclick: / :click-incorrect:left:endclick:] by a 120 degrees. + This determines the direction the turtle will face for the [:click-correct:next:endclick: / :click-incorrect:current:endclick:] iteration. + (9) draw_triangle(alex, 50, ["blue", "green", "yellow"]) -- Call Function + Calls the draw_triangle function with the specified turtle object, side length, and list of colors to draw an equilateral triangle. + + +.. raw:: html + +

Click on the following link to finish the next puzzle: Mixed-up Puzzle 4

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/pps-ppe4.rst b/_sources/turtles/SE_turtle/pps-ppe4.rst new file mode 100644 index 00000000..5083b2af --- /dev/null +++ b/_sources/turtles/SE_turtle/pps-ppe4.rst @@ -0,0 +1,72 @@ +Complete the following sections to get an explanation for the completed puzzle +============================================================================== + +.. clickablearea:: SE_tutles_4 + :question: Complete the following sections to get an explanation for the completed puzzle: + :prim_comp: ASSIGNMENT + :iscode: + :feedback: + + + Here is a completed function: + + + (1) from turtle import * -- Importing Turtle Graphicss + Use import * to import all functions, classes, and variables from the Turtle graphics library into the current namespace. + (2) def draw_diamond(turtle, xpos, ypos, length, color): -- Function Definition + Defines a function named draw_diamond that takes five parameters: turtle (a Turtle object), xpos and ypos (coordinates for position), length (side length of the diamond), and color (color of the diamond). + (3) turtle.penup() -- Lift Pen Up + Lifts the turtle's pen so that it [:click-correct:does now draw:endclick: / :click-incorrect:draws:endclick:] while moving to the start position. + (4) turtle.goto(xpos, ypos) -- Move to Start Position + Use .goto() to move the turtle to the specified (xpos, ypos) coordinates. + (5) turtle.left(45) -- Rotate for Diamond Orientation + Rotates the turtle left by 45 degrees to orient it for drawing the diamond. + (6) turtle.pendown() -- Lower Pen Down + Lowers the pen so that the turtle will [:click-incorrect:not draw:endclick: / :click-correct:start drawing:endclick:] when it moves. + (7) turtle.color(color) -- Set Pen Color + Sets the color of the turtle’s pen to the specified color stored in the variable color. + (8) turtle.begin_fill() -- Start Filling a Shape with a Color + Use [:click-incorrect:.beginfill():endclick: / :click-correct:.begin_fill():endclick:] to start the filling process, so the shape will be filled with the specified color when completed. + (9) for i in range(4): -- A Loop to Draw the Outline of the Diamond + Starts a loop that will iterate [:click-incorrect:five:endclick: / :click-correct:four:endclick:] times to draw the four sides of the diamond. + (10) turtle.forward(length) -- Move Forward to Draw the Outline of the Shape + Moves the turtle forward by the specified length to draw one side of the diamond. + (11) turtle.left(90) -- Turn 90 Degrees Left + Turns the turtle left by 90 degrees to prepare for drawing the [:click-correct:next:endclick: / :click-incorrect:current:endclick:] side. + (12) turtle.end_fill() -- End Filling the Shape with the Color + Use [:click-incorrect:.beginfill():endclick: / :click-correct:.end_fill():endclick:] to end the filling process, completing the filled shape with the specified color. + + +.. raw:: html + +

Click on the following link to finish the posttest: Posttest

+ +.. raw:: html + + \ No newline at end of file diff --git a/_sources/turtles/SE_turtle/turtle_SE-entry.rst b/_sources/turtles/SE_turtle/turtle_SE-entry.rst new file mode 100644 index 00000000..06b99d47 --- /dev/null +++ b/_sources/turtles/SE_turtle/turtle_SE-entry.rst @@ -0,0 +1,185 @@ +Know more about your current state +================================== + +Your self-efficacy in Computer Science +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. poll:: SE-CS-self-efficacy-1 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + Generally I have felt secure about attempting computer programming problems. + +.. poll:: SE-CS-self-efficacy-2 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + I am sure I could do advanced work in computer science. + +.. poll:: SE-CS-self-efficacy-3 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + I am sure that I can learn programming. + +.. poll:: SE-CS-self-efficacy-4 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + I think I could handle more difficult programming problems. + +.. poll:: SE-CS-self-efficacy-5 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + I can get good grades in computer science. + +.. poll:: SE-CS-self-efficacy-6 + :option_1: Strongly disagree + :option_2: Disagree + :option_3: Neither agree nor disagree + :option_4: Agree + :option_5: Strongly agree + :results: instructor + + I have a lot of self-confidence when it comes to programming. + + +Your familiarity with the turtle module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For the next four questions, please select the answer that best matches your familiarity and confidence about the specified concept(s). + +.. poll:: turtle-1 + :option_1: I am unfamiliar with this concept + :option_2: I know what it means, but have not used it in a program + :option_3: I have used this concept in a program, but am not confident about my ability to use it + :option_4: I am confident in my ability to use this concept in simple programs + :option_5: I am confident in my ability to use this concept in complex programs + :results: instructor + + Moves the turtle forward like forward() + +.. poll:: turtle-2 + :option_1: I am unfamiliar with this concept + :option_2: I know what it means, but have not used it in a program + :option_3: I have used this concept in a program, but am not confident about my ability to use it + :option_4: I am confident in my ability to use this concept in simple programs + :option_5: I am confident in my ability to use this concept in complex programs + :results: instructor + + Creat a turtle space like Screen() + +.. poll:: turtle-3 + :option_1: I am unfamiliar with this concept + :option_2: I know what it means, but have not used it in a program + :option_3: I have used this concept in a program, but am not confident about my ability to use it + :option_4: I am confident in my ability to use this concept in simple programs + :option_5: I am confident in my ability to use this concept in complex programs + :results: instructor + + Set the direction the turtle faces like setheading(angle) + +.. poll:: turtle-4 + :option_1: I am unfamiliar with this concept + :option_2: I know what it means, but have not used it in a program + :option_3: I have used this concept in a program, but am not confident about my ability to use it + :option_4: I am confident in my ability to use this concept in simple programs + :option_5: I am confident in my ability to use this concept in complex programs + :results: instructor + + Set turtle's pen color like color(color) + + + +What to do next +^^^^^^^^^^^^^^^^ +.. raw:: html + +

Click on the following link to learn how to solve different types of problems in this ebook : Introduction to Problem Types

+ +.. raw:: html + + + +