diff --git a/_sources/turtles/SE_turtle/index.rst b/_sources/turtles/SE_turtle/index.rst index ee53e572..e23cd3c2 100644 --- a/_sources/turtles/SE_turtle/index.rst +++ b/_sources/turtles/SE_turtle/index.rst @@ -4,8 +4,8 @@ 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. +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 (UM IRB HUM00253438). +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. @@ -18,12 +18,7 @@ The four parts are: - **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. +Only your anonymous log fles from this session will be used for this study. No identifiable information will be collected. You will not be graded on your performance. If you have questions at any time about the study or the procedures, you may contact the researcher at email xyhou@umich.edu. diff --git a/_sources/turtles/SE_turtle/pp-intro-IE.rst b/_sources/turtles/SE_turtle/pp-intro-IE.rst index a865cfc2..cab392f9 100644 --- a/_sources/turtles/SE_turtle/pp-intro-IE.rst +++ b/_sources/turtles/SE_turtle/pp-intro-IE.rst @@ -12,15 +12,6 @@ You may need to indent the blocks as well. There may also be extra blocks that 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 diff --git a/_sources/turtles/SE_turtle/pp-intro-PP.rst b/_sources/turtles/SE_turtle/pp-intro-PP.rst index a9bf4db7..ef659754 100644 --- a/_sources/turtles/SE_turtle/pp-intro-PP.rst +++ b/_sources/turtles/SE_turtle/pp-intro-PP.rst @@ -13,15 +13,6 @@ may need to indent the blocks as well. There may also be extra blocks that are 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 diff --git a/_sources/turtles/SE_turtle/pp-intro-SE.rst b/_sources/turtles/SE_turtle/pp-intro-SE.rst index 80e773c6..3da21b18 100644 --- a/_sources/turtles/SE_turtle/pp-intro-SE.rst +++ b/_sources/turtles/SE_turtle/pp-intro-SE.rst @@ -13,15 +13,6 @@ may need to indent the blocks as well. There may also be extra blocks that are 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 @@ -100,21 +91,22 @@ The clicable area are those with a dark gray background and a border around them You will then receive a completed explanatoin of the solution you got from solving the mixed-up puzzle. - - +.. image:: https://i.postimg.cc/SmDGs7mZ/SE-introduction.png + :width: 600 + :align: center 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. +๐Ÿ‘‰ Detailed feedback on how many options you got correct or wrong. 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. +๐Ÿ‘‰ Hints on how to correct the wrong 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 +๐Ÿ‘‰ Highlighted incorrect 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. @@ -127,7 +119,9 @@ Try to solve the following explanation problem. You can click on the options to :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:]. diff --git a/_sources/turtles/SE_turtle/pps-IE-pp1.rst b/_sources/turtles/SE_turtle/pps-IE-pp1.rst index 44f0f04d..dc0574cd 100644 --- a/_sources/turtles/SE_turtle/pps-IE-pp1.rst +++ b/_sources/turtles/SE_turtle/pps-IE-pp1.rst @@ -5,7 +5,7 @@ Practice Problems :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. + Create a function called ``create_T`` that takes in ``turtle_obj`` 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 * @@ -30,6 +30,8 @@ Practice Problems turtle_obj.forward(height) +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -39,44 +41,56 @@ Practice Problems .. 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 index c9b90151..da1502ee 100644 --- a/_sources/turtles/SE_turtle/pps-IE-pp2.rst +++ b/_sources/turtles/SE_turtle/pps-IE-pp2.rst @@ -16,9 +16,12 @@ Practice Problems def create_hexagon(turtle): ===== for i in range(0, 6): - ===== turtle.forward(50) ===== + for i in range(0, 6): + turtle = turtle.forward(50) #paired + ===== + for i in range(0, 7): turtle = turtle.forward(50) #paired ===== turtle.left(60) @@ -27,6 +30,10 @@ Practice Problems ===== create_hexagon(alex) + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

@@ -34,44 +41,56 @@ Practice Problems .. 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 index 5ea278ba..db065e81 100644 --- a/_sources/turtles/SE_turtle/pps-IE-pp3.rst +++ b/_sources/turtles/SE_turtle/pps-IE-pp3.rst @@ -31,6 +31,8 @@ Practice Problems draw_triangle(alex, 50, ["blue", "green", "yellow"]) +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -39,44 +41,56 @@ Practice Problems .. 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 index 084a5a51..a24a5935 100644 --- a/_sources/turtles/SE_turtle/pps-IE-pp4.rst +++ b/_sources/turtles/SE_turtle/pps-IE-pp4.rst @@ -6,32 +6,36 @@ Practice Problems :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``. + Create a function called ``create_rectangle`` that takes in ``turtle`` as a parameter and creates a rectangle of width 40 and height 90. + Create a Screen object and a Turtle object. After creating the function, call ``create_rectangle``. ----- from turtle import * - def draw_diamond(turtle, xpos, ypos, length, color): + space = Screen() + alex = Turtle() ===== - turtle.penup() - turtle.goto(xpos, ypos) + def create_rectangle(turtle): ===== - turtle.left(45) + for i in range(2): + turtle.forward(40) ===== - turtle.left(90) #paired + for i in turtle.range(2): + turtle.forward(40) #paired ===== - turtle.pendown() + for i in turtle.range(1, 2): + turtle.forward(40) #paired ===== - turtle.color(color) - ===== - turtle.side(color) #paired + turtle.left(90) ===== - turtle.begin_fill() + turtle.forward(90) ===== - for i in range(4): - turtle.forward(length) turtle.left(90) ===== - turtle.end_fill() + create_rectangle(alex) + + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html @@ -40,44 +44,56 @@ Practice Problems .. 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 index c53cc2a7..effee9b1 100644 --- a/_sources/turtles/SE_turtle/pps-PP-1.rst +++ b/_sources/turtles/SE_turtle/pps-PP-1.rst @@ -5,7 +5,7 @@ Practice Problems :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. + Create a function called ``create_T`` that takes in ``turtle_obj`` 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 * @@ -31,6 +31,9 @@ Practice Problems +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

@@ -39,45 +42,56 @@ Practice Problems .. 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 index 1161d0c4..f21d46a3 100644 --- a/_sources/turtles/SE_turtle/pps-PP-2.rst +++ b/_sources/turtles/SE_turtle/pps-PP-2.rst @@ -13,22 +13,29 @@ Practice Problems space = Screen() alex = Turtle() ===== - def create_hexagon(turtle_obj): + def create_hexagon(turtle): ===== for i in range(0, 6): + turtle.forward(50) ===== - for i in range(0, 7): #paired + for i in range(0, 6): + turtle = turtle.forward(50) #paired ===== - turtle_obj.forward(50) + for i in range(0, 7): + turtle = turtle.forward(50) #paired ===== - turtle_obj = turtle_obj.forward(50) #paired + turtle.left(60) ===== - turtle_obj.left(60) + turtle = turtle.left(60) #paired ===== create_hexagon(alex) +What to do next +^^^^^^^^^^^^^^^ + + .. raw:: html

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

@@ -36,44 +43,56 @@ Practice Problems .. 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 index 064896f9..964ab3ad 100644 --- a/_sources/turtles/SE_turtle/pps-PP-3.rst +++ b/_sources/turtles/SE_turtle/pps-PP-3.rst @@ -31,6 +31,8 @@ Practice Problems draw_triangle(alex, 50, ["blue", "green", "yellow"]) +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -39,44 +41,56 @@ Practice Problems .. 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 index eb6665c4..77e51216 100644 --- a/_sources/turtles/SE_turtle/pps-PP-4.rst +++ b/_sources/turtles/SE_turtle/pps-PP-4.rst @@ -6,32 +6,35 @@ Practice Problems :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``. + Create a function called ``create_rectangle`` that takes in ``turtle`` as a parameter and creates a rectangle of width 40 and height 90. + Create a Screen object and a Turtle object. After creating the function, call ``create_rectangle``. ----- from turtle import * - def draw_diamond(turtle, xpos, ypos, length, color): + space = Screen() + alex = Turtle() ===== - turtle.penup() - turtle.goto(xpos, ypos) + def create_rectangle(turtle): ===== - turtle.left(45) + for i in range(2): + turtle.forward(40) ===== - turtle.left(90) #paired + for i in turtle.range(2): + turtle.forward(40) #paired ===== - turtle.pendown() + for i in turtle.range(1, 2): + turtle.forward(40) #paired ===== - turtle.color(color) - ===== - turtle.side(color) #paired + turtle.left(90) ===== - turtle.begin_fill() + turtle.forward(90) ===== - for i in range(4): - turtle.forward(length) turtle.left(90) ===== - turtle.end_fill() + create_rectangle(alex) + + +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -40,44 +43,56 @@ Practice Problems .. 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 index ccf4dccf..94e715ba 100644 --- a/_sources/turtles/SE_turtle/pps-SE-pp1.rst +++ b/_sources/turtles/SE_turtle/pps-SE-pp1.rst @@ -5,7 +5,7 @@ Practice Problems :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. + Create a function called ``create_T`` that takes in ``turtle_obj`` 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 * @@ -30,7 +30,8 @@ Practice Problems turtle_obj.forward(height) - +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -42,42 +43,54 @@ Practice Problems \ 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 index 08ee8252..5f380b08 100644 --- a/_sources/turtles/SE_turtle/pps-SE-pp2.rst +++ b/_sources/turtles/SE_turtle/pps-SE-pp2.rst @@ -16,9 +16,12 @@ Practice Problems def create_hexagon(turtle): ===== for i in range(0, 6): - ===== turtle.forward(50) ===== + for i in range(0, 6): + turtle = turtle.forward(50) #paired + ===== + for i in range(0, 7): turtle = turtle.forward(50) #paired ===== turtle.left(60) @@ -27,6 +30,11 @@ Practice Problems ===== create_hexagon(alex) + + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

@@ -34,44 +42,56 @@ Practice Problems .. 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 index cc032c08..86552135 100644 --- a/_sources/turtles/SE_turtle/pps-SE-pp3.rst +++ b/_sources/turtles/SE_turtle/pps-SE-pp3.rst @@ -31,6 +31,8 @@ Practice Problems draw_triangle(alex, 50, ["blue", "green", "yellow"]) +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -41,42 +43,54 @@ Practice Problems \ 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 index 75aa1dc5..7815368e 100644 --- a/_sources/turtles/SE_turtle/pps-SE-pp4.rst +++ b/_sources/turtles/SE_turtle/pps-SE-pp4.rst @@ -6,33 +6,36 @@ Practice Problems :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``. + Create a function called ``create_rectangle`` that takes in ``turtle`` as a parameter and creates a rectangle of width 40 and height 90. + Create a Screen object and a Turtle object. After creating the function, call ``create_rectangle``. ----- from turtle import * - def draw_diamond(turtle, xpos, ypos, length, color): + space = Screen() + alex = Turtle() ===== - turtle.penup() - turtle.goto(xpos, ypos) + def create_rectangle(turtle): ===== - turtle.left(45) + for i in range(2): + turtle.forward(40) ===== - turtle.left(90) #paired + for i in turtle.range(2): + turtle.forward(40) #paired ===== - turtle.pendown() + for i in turtle.range(1, 2): + turtle.forward(40) #paired ===== - turtle.color(color) - ===== - turtle.side(color) #paired + turtle.left(90) ===== - turtle.begin_fill() + turtle.forward(90) ===== - for i in range(4): - turtle.forward(length) turtle.left(90) ===== - turtle.end_fill() + create_rectangle(alex) + + +What to do next +^^^^^^^^^^^^^^^ .. raw:: html @@ -41,44 +44,56 @@ Practice Problems .. 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 index 549ca0d8..617c456b 100644 --- a/_sources/turtles/SE_turtle/pps-ie1.rst +++ b/_sources/turtles/SE_turtle/pps-ie1.rst @@ -9,7 +9,7 @@ Here is an explanation for the completed puzzle 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. @@ -22,22 +22,28 @@ Here is an explanation for the completed puzzle (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. + Moves the turtle to the starting position at the top-left part of the T, which is the point (-50, 75). -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. + 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. (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. + Use / to perform standard division and returns the quotient as a floating-point number. + However, operator % performs division and returns the remainder 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. + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

diff --git a/_sources/turtles/SE_turtle/pps-ie2.rst b/_sources/turtles/SE_turtle/pps-ie2.rst index 0ab2b9ed..3669dea3 100644 --- a/_sources/turtles/SE_turtle/pps-ie2.rst +++ b/_sources/turtles/SE_turtle/pps-ie2.rst @@ -9,14 +9,15 @@ Here is an explanation for the completed puzzle 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. + Initializes a Turtle object named alex using Turtle(). + alex is a variable used to name an object 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. @@ -31,6 +32,9 @@ Here is an explanation for the completed puzzle (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. +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html diff --git a/_sources/turtles/SE_turtle/pps-ie3.rst b/_sources/turtles/SE_turtle/pps-ie3.rst index f787d365..bdee7d84 100644 --- a/_sources/turtles/SE_turtle/pps-ie3.rst +++ b/_sources/turtles/SE_turtle/pps-ie3.rst @@ -15,7 +15,8 @@ Here is an explanation for the completed puzzle (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. + Initializes a Turtle object named alex using Turtle(). + alex is a variable used to name an object 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. @@ -34,6 +35,9 @@ Here is an explanation for the completed puzzle Calls the draw_triangle function with the specified turtle object, side length, and list of colors to draw an equilateral triangle. +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

diff --git a/_sources/turtles/SE_turtle/pps-ie4.rst b/_sources/turtles/SE_turtle/pps-ie4.rst index fd8362d5..5a4ba98c 100644 --- a/_sources/turtles/SE_turtle/pps-ie4.rst +++ b/_sources/turtles/SE_turtle/pps-ie4.rst @@ -2,40 +2,42 @@ Here is an explanation for the completed puzzle ================================================ .. clickablearea:: IE_tutles_4 - :question: An explanation for the completed puzzle: + :question: Complete the following sections to get an explanation for the completed puzzle: :prim_comp: ASSIGNMENT :iscode: - :feedback: - + :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. + (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 name an object of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def create_rectangle(turtle): -- Function Definition + Defines a function named create_rectangle that takes a single parameter turtle, which is expected to be a Turtle object. + (5) for i in range(2): -- Loop Through Iterations + Starts a loop that will iterate twice. + Each iteration draws two sides of the rectangle. + (6) turtle.forward(40) -- Draw Width of Rectangle + Moves the turtle forward by 40 units to draw one of the shorter sides of the rectangle (width). + (7) turtle.left(90) -- Turn 90 Degrees Left + Turns the turtle left by 90 degrees to prepare for drawing the next side of the rectangle. + (8) turtle.forward(90) -- Draw Height of Rectangle + Moves the turtle forward by 90 units to draw one of the longer sides of the rectangle (height). + (9) turtle.left(90) -- Turn 90 Degrees Left Again + Turns the turtle left by 90 degrees to prepare for drawing the next side. + This completes one iteration of the loop and half of the rectangle. + (10) create_rectangle(alex) -- Call Function + Calls the create_rectangle function after creating it with the specified turtle object alex to draw a rectangle. + +What to do next +^^^^^^^^^^^^^^^ .. raw:: html diff --git a/_sources/turtles/SE_turtle/pps-posttest.rst b/_sources/turtles/SE_turtle/pps-posttest.rst index b9690d16..59681f8b 100644 --- a/_sources/turtles/SE_turtle/pps-posttest.rst +++ b/_sources/turtles/SE_turtle/pps-posttest.rst @@ -3,193 +3,215 @@ 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. - +* There is no feedback for this posttest. You will see the correct answers after the lecture on Thursday. -.. timed:: timed_posttest - :timelimit: 15 - - .. poll:: SE_posttest_tf_1 - :option_1: True - :option_2: False +* Again, you can stop working on a problem after you worked on it for about two minutes without solving it. - True or False: In the turtle module, the method penup() is used to resume drawing when the turtle moves. +One correct option MCQ +^^^^^^^^^^^^^^^^^^^^^^ - .. poll:: SE_posttest_tf_2 - :option_1: True - :option_2: False +.. poll:: SE_posttest_mcq_1 + :option_1: In the turtle module, the method penup() is used to resume drawing when the turtle moves. + :option_2: In the turtle module, the method penup() is used to change the thickness of the pen. + :option_3: In the turtle module, the method pendown() is used to resume drawing when the turtle moves. + :option_4: In the turtle module, the method pendown() and penup() both control the turtle's speed. - True or False: The color() method in the turtle module is used to change the background color of the graphics window. + One correct option MCQ: Which of the following statements is true regarding the penup() and pendown() in Python turtle module? + + +.. poll:: SE_posttest_mcq_2 + :option_1: color() sets the pen color but does not affect the background color. + :option_2: color() sets the pen color and the background color of the drawing window. + :option_3: color() changes the pen color and pen size, but not the background color. + :option_4: color() affects the fill color and background color, but not the pen color. + One correct option MCQ: Which of the following statements is true regarding the color() method in Python turtle module? - .. 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. +.. poll:: SE_posttest_mcq_3 + :option_1: Turtle is a variable, and alex is an object of the class. + :option_2: Turtle is a class, and alex is a variable used to an object 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? + One correct option MCQ: In the statement alex = Turtle(), what do Turtle and alex mean? - .. 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): +.. 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): + 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 +.. poll:: SE_posttest_mcq_5 + :option_1: A + :option_2: B + :option_3: C + :option_4: D + One correct option MCQ: What is the output of the following code snippet? +
+ - .. mchoice:: SE_posttest_mcq_6 - :multiple_answers: - Select all that apply: The following code snippet produces one or more errors. - - ``from turtle import all`` +Fill in all that apply +^^^^^^^^^^^^^^^^^^^^^^ - ``Turtle()`` +.. fillintheblank:: SE_posttest_mcq_6 + :practice: F - ``t = t.color("blue")`` + **Enter the correct letter(s) in the blanks. More than one answer may be correct.** + + Which of the following statements are true regarding the differences and similarities between the two loops? Fill in all that apply. - - The turtle module is not imported correctly. + .. image:: https://i.postimg.cc/4yCs9L3h/SE-posttest-mcq-6.png + :width: 600 + :align: center - + Thank you for answering the question. + **A.** The ``for i in range(5)`` loop iterates a fixed number of times, specifically 5 times. + + **B.** The ``for item in item_list`` loop modifies the original list elements during iteration. + + **C.** Both loops can be used to iterate over a sequence of numbers. + + **D.** Both code snippets will print out the same sequence of numbers. - - Turtle() needs to be assigned to a variable. + - :[\s\S]+: Thank you for answering the question. + :.*: Please fill in the blank - + Thank you for answering the question. - - The color method does not exist. - + Thank you for answering the question. +.. fillintheblank:: SE_posttest_mcq_7 + :practice: F - - The third line should call color() method without trying to assign it to a value. - - + Thank you for answering the question. + **Enter the correct letter(s) in the blanks. More than one answer may be correct.** + + The following code snippet produces one or more errors. Fill in all that apply. - - The t.color() method should not be used with an argument, such as "blue". - - + Thank you for answering the question. - - + ``from turtle import all`` - .. mchoice:: SE_posttest_mcq_7 - :multiple_answers: + ``Turtle()`` - Select all that apply: Which of the following statements are true regarding the differences and similarities between the two loops? + ``t = t.color("blue")`` - .. image:: https://i.postimg.cc/4yCs9L3h/SE-posttest-mcq-6.png + **A.** The turtle module is not imported correctly. + + **B.** In this case, Turtle() needs to be assigned to a variable. + + **C.** The color method does not exist in the turtle module. + + **D.** The t.color() method should not be used with an argument, such as "blue". - - The ``for i in range(5)`` loop iterates a fixed number of times, specifically 5 times. + - :[\s\S]+: Thank you for answering the question. + :.*: Please fill in the blank - + 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. +.. fillintheblank:: SE_posttest_mcq_8 + :practice: F - + Thank you for answering the question. - - - Both code snippets will print out the same sequence of numbers. + **Enter the correct letter(s) in the blanks. More than one answer may be correct.** + + Which of the following statements are true regarding the ``t.left(90)`` line in the code? Fill in all that apply. - + Thank you for answering the question. + ``import turtle`` + ``t = turtle.Turtle()`` - .. mchoice:: SE_posttest_mcq_8 - :multiple_answers: + ``t.left(90)`` - **Select all that apply:** Which of the following statements are true regarding the ``t.left(90)`` line in the code? - ``import turtle`` + **A.** The turtle turns 90 degrees to the right. - ``t = turtle.Turtle()`` + **B.** The turtle turns 90 degrees to the left. - ``t.left(90)`` + **C.** The turtle makes a circle. + **D.** The turtle's orientation changes, but it doesn't move from its current position. - - The turtle turns 90 degrees to the right. + **E.** The turtle moves 90 units to the left. - + Thank you for answering the question. + - :[\s\S]+: Thank you for answering the question. + :.*: Please fill in the blank - - 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. +.. fillintheblank:: SE_posttest_mcq_9 + :practice: F - - The turtle's orientation changes, but it doesn't move from its current position. - - + Thank you for answering the question. + **Enter the correct letter(s) in the blanks. More than one answer may be correct.** + + All code statements that will draw **rectangle** using the turtle module in Python: Fill in all that apply. + + .. image:: https://i.postimg.cc/09F4kV6x/SE-posttest-mcq-9.png + :width: 800 + :align: center - - The turtle turns 180 degrees to the left. - - + Thank you for answering the question. + - :[\s\S]+: Thank you for answering the question. + :.*: Please fill in the blank +.. shortanswer:: SE_posttest_sa_10 - .. mchoice:: SE_posttest_mcq_9 - :multiple_answers: + What is the purpose of the following line of code in the turtle module? - **Select all that apply:** All code statements that will draw a **rectangle** using the turtle module in Python: + ``t.goto(100, 100)`` - .. image:: https://i.postimg.cc/L8JL95GQ/SE-posttest-mcq-9.png - - A - + Thank you for answering the question. +Turtle Reflective Survey +^^^^^^^^^^^^^^^^^^^^^^^^ - - B +.. shortanswer:: SE_learning - + Thank you for answering the question. + What did you **learn** from this practice session? - - C - + Thank you for answering the question. +.. poll:: SE_reflect_1 + :allowcomment: + :option_1: Strongly Disagree + :option_2: Disagree + :option_3: Neither agree or disagree + :option_4: Agree + :option_5: Strongly Agree - - D + For each statement, please use the following scale to indicate what is most true for you. Explain the reason for your choice in the comment box below. +
+ This practice was useful in improving my problem-solving skill on this topic, e.g. finding the strategy to draw an expected shape using a turtle module. - + Thank you for answering the question. - +.. poll:: SE_reflect_2 + :allowcomment: + :option_1: Strongly Disagree + :option_2: Disagree + :option_3: Neither agree or disagree + :option_4: Agree + :option_5: Strongly Agree + + For each statement, please use the following scale to indicate what is most true for you. Explain the reason for your choice in the comment box below. +
+ This practice was useful in improving my understanding of this topic, e.g. what does different turtle method and for loop do, etc. - .. shortanswer:: SE_posttest_sa_10 - What is the purpose of the following line of code in the turtle module? +.. shortanswer:: SE_opinion - ``t.goto(100, 100)`` + What did you think of this practice session? Please provide any feedback or suggestions for improvement. -.. 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. +Thank you for taking part in this session! We appreciate your time on this. diff --git a/_sources/turtles/SE_turtle/pps-ppe1.rst b/_sources/turtles/SE_turtle/pps-ppe1.rst index 035f592b..8eb9b84e 100644 --- a/_sources/turtles/SE_turtle/pps-ppe1.rst +++ b/_sources/turtles/SE_turtle/pps-ppe1.rst @@ -1,14 +1,11 @@ -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: + :question: Complete this section to get an explanation for the previous puzzle :prim_comp: ASSIGNMENT :iscode: - :feedback: - - - Here is a completed function: + :feedback: (1) Think about how to import all functions from the Turtle graphics library. (5) Think about what .penup() does. (6) Think about the meaning of negative and postive value in the context of goto a position. (7) Think about the purpose of .pendown() function. (8) Think about the purpose of the .forward() function. (9) Think about the output of the / operation in a division between two numbers. (10) Think about the purpose of the .right() function. + + (1) from turtle import * -- Importing Turtle Graphicss @@ -22,22 +19,29 @@ Complete the following sections to get an explanation for the completed puzzle (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. + Moves the turtle to the starting position at the top-left part of the T, which is the point (-50, 75). + -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. + Use / to perform standard division and returns the [:click-correct:quotient:endclick: / :click-incorrect:reminder:endclick:] as a floating-point number. + However, operator % performs division and returns the remainder 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. + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

diff --git a/_sources/turtles/SE_turtle/pps-ppe2.rst b/_sources/turtles/SE_turtle/pps-ppe2.rst index aace43f3..fdc6ebc1 100644 --- a/_sources/turtles/SE_turtle/pps-ppe2.rst +++ b/_sources/turtles/SE_turtle/pps-ppe2.rst @@ -1,30 +1,27 @@ -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: + :question: Complete this section to get an explanation for the previous puzzle :prim_comp: ASSIGNMENT :iscode: - :feedback: - - + :feedback: (1) Think about how to import all functions from the Turtle graphics library. (3) Think about the type of alex in the function call. Think about the type of Turtle() from the turtle module. (5) Think about the loop range by start and stop values. (7) Think about the purpose of the left() function. + 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. + 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. + Initializes a Turtle object named alex using Turtle(). alex is a [:click-correct:variable:endclick: / :click-incorrect:method:endclick:] used to name an object of the Turtle [:click-correct:class:endclick: / :click-incorrect:variable:endclick:]. 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. + Initializes a loop that will iterate [:click-correct:6:endclick: / :click-incorrect:7:endclick: / :click-incorrect:5:endclick:] 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. + 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 [: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. @@ -32,6 +29,10 @@ Complete the following sections to get an explanation for the completed puzzle Calls the create_hexagon function, passing the Turtle object alex as an argument. This initiates the drawing of the hexagon. + +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

diff --git a/_sources/turtles/SE_turtle/pps-ppe3.rst b/_sources/turtles/SE_turtle/pps-ppe3.rst index c8bf2a48..ed891b91 100644 --- a/_sources/turtles/SE_turtle/pps-ppe3.rst +++ b/_sources/turtles/SE_turtle/pps-ppe3.rst @@ -1,11 +1,9 @@ -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: + :question: Complete this section to get an explanation for the previous puzzle :prim_comp: ASSIGNMENT :iscode: - :feedback: + :feedback: (3) Think about the type of alex in the function call. Think about the type of Turtle() from the turtle module. (5) Think about the loop range by start and stop values. (6) Think about the index used to access colors in the list. (8) Think about the angle used to turn the turtle for the next side of the triangle. Think about which direction it turns. Here is a completed function: @@ -15,7 +13,8 @@ Complete the following sections to get an explanation for the completed puzzle (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. + Initializes a Turtle object named alex using Turtle(). + alex is a [:click-correct:variable:endclick: / :click-incorrect:method:endclick:] used to name an object of the Turtle [:click-correct:class:endclick: / :click-incorrect:variable:endclick:]. 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. @@ -28,12 +27,15 @@ Complete the following sections to get an explanation for the completed puzzle (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. + Rotates the turtle to the right by a [:click-correct:120:endclick: / :click-incorrect:240:endclick:] 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. +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

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

diff --git a/_sources/turtles/SE_turtle/pps-ppe4.rst b/_sources/turtles/SE_turtle/pps-ppe4.rst index 5083b2af..f74dcf89 100644 --- a/_sources/turtles/SE_turtle/pps-ppe4.rst +++ b/_sources/turtles/SE_turtle/pps-ppe4.rst @@ -1,42 +1,43 @@ -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: + :question: Complete this section to get an explanation for the previous puzzle :prim_comp: ASSIGNMENT :iscode: - :feedback: + :feedback: (5) Think about the type of loop and how it works. (6) Think about the meaning of .forward(). (9) Think about the last action of each iteration. (10) Think about the correct sequence to call the function to draw a rectangle. 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. + (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 name an object of the Turtle class. + This allows you to control and use that specific turtle object to perform various drawing operations. + (4) def create_rectangle(turtle): -- Function Definition + Defines a function named create_rectangle that takes a single parameter turtle, which is expected to be a Turtle object. + (5) for i in range(2): -- Loop Through Iterations + Starts a [:click-correct:for:endclick: / :click-incorrect:while:endclick:] loop that will iterate [:click-incorrect:fourth:endclick: / :click-correct:twice:endclick:]. + Each iteration draws [:click-correct:two sides:endclick: / :click-incorrect:one side:endclick:] of the rectangle. + (6) turtle.forward(40) -- Draw Width of Rectangle + Moves the turtle [:click-correct:forward:endclick: / :click-incorrect:backward:endclick:] by 40 units to draw one of the shorter sides of the rectangle (width). + (7) turtle.left(90) -- Turn 90 Degrees Left + Turns the turtle left by 90 degrees to prepare for drawing the next side of the rectangle. + (8) turtle.forward(90) -- Draw Height of Rectangle + Moves the turtle forward by 90 units to draw one of the longer sides of the rectangle (height). + (9) turtle.left(90) -- Turn 90 Degrees Left Again + Turns the turtle left by 90 degrees to prepare for drawing the [:click-incorrect:current:endclick: / :click-correct:next:endclick:] side. + This completes one iteration of the loop and half of the rectangle. + (10) create_rectangle(alex) -- Call Function + Calls the create_rectangle function [:click-correct:after:endclick: / :click-incorrect:before:endclick:] creating it with the specified turtle object alex to draw a rectangle. +What to do next +^^^^^^^^^^^^^^^ + .. raw:: html

Click on the following link to finish the posttest: Posttest

diff --git a/_sources/turtles/SE_turtle/turtle_SE-entry.rst b/_sources/turtles/SE_turtle/turtle_SE-entry.rst index 06b99d47..ae617a39 100644 --- a/_sources/turtles/SE_turtle/turtle_SE-entry.rst +++ b/_sources/turtles/SE_turtle/turtle_SE-entry.rst @@ -1,6 +1,3 @@ -Know more about your current state -================================== - Your self-efficacy in Computer Science ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -88,7 +85,7 @@ For the next four questions, please select the answer that best matches your fam :option_5: I am confident in my ability to use this concept in complex programs :results: instructor - Creat a turtle space like Screen() + Creates a turtle drawing area like Screen() .. poll:: turtle-3 :option_1: I am unfamiliar with this concept @@ -98,7 +95,7 @@ For the next four questions, please select the answer that best matches your fam :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) + Turns the turtle like left(angle) .. poll:: turtle-4 :option_1: I am unfamiliar with this concept @@ -108,7 +105,7 @@ For the next four questions, please select the answer that best matches your fam :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) + Sets the turtle's pen color like color(color)