The Create Performance Task (guided) · สร้างงานสร้างประสิทธิภาพ (แบบมีคำแนะนำ)
The Create Performance Task
- The Create Performance Task is a small program you design and build yourself.
- For the real AP exam you submit it (your code, a video, and written answers) through the AP Digital Portfolio.
- Important: the real task is graded by AP, not by this site. This lesson only helps you practice and structure it.
งานสร้างประสิทธิภาพ (Create Performance Task)
- งานสร้างประสิทธิภาพ คือโปรแกรมขนาดเล็กที่คุณออกแบบและสร้างเอง
- สำหรับข้อสอบ AP จริง คุณต้องส่งงานนี้ (โค้ด, วิดีโอ, และคำตอบแบบเขียน) ผ่าน AP Digital Portfolio
- สำคัญ: งานจริงจะถูกประเมินโดย AP ไม่ใช่ โดยเว็บsite นี้ บทเรียนนี้ช่วยคุณเพียงเพื่อ ฝึกฝน และจัดโครงสร้างเท่านั้น
What your program must include
- A list (or other collection) that stores many values together.
- A procedure (a function) that takes at least one parameter, and that you call in your code.
- An algorithm with selection (
if) inside iteration (a loop). - Some input and some output so the program does something useful.
โปรแกรมของคุณต้องมีสิ่งใดบ้าง
- ลิสต์ (list) หรือกลุ่มเก็บข้อมูลอื่นๆ ที่ใช้เก็บค่าหลายค่าไว้ด้วยกัน
- กระบวนการ (procedure/ฟังก์ชัน) ที่รับ พารามิเตอร์อย่างน้อยหนึ่งตัว และคุณต้อง เรียกใช้งาน它在โค้ดของคุณ
- อัลกอริทึม ที่มี การเลือก (
if) อยู่ภายใน การทำซ้ำ (loop) - มี อินพุต และ เอาต์พุต บางส่วน เพื่อให้โปรแกรมทำงานที่มีประโยชน์
Pick a small idea
- Keep it simple: you only need to show the skills above, not build a huge app.
- Good ideas: grade a list of scores, total a shopping list, sort students into teams, count words.
- Choose data you understand, so you can explain it later.
เลือกไอเดียเล็กๆ น้อยๆ
- ให้ง่าย: คุณไม่จำเป็นต้องสร้างแอปพลิเคชันใหญ่โต เพียงแค่แสดงทักษะข้างต้นก็พอ
- ไอเดียที่ดี: ให้คะแนนลิสต์ผลสอบ, รวมรายการช้อปปิ้ง, จัดกลุ่มนักเรียน,นับจำนวนคำ
- เลือกข้อมูลที่คุณเข้าใจ เพื่อที่จะได้อธิบายมันในภายหลัง
A starter scaffold
- The program below has all the required parts. Read the comments to find each one.
- It uses a fixed list so it runs the same every time (no live typing needed here).
- Run it, then change the data and rules to make it your own.
โครงร่างเริ่มต้น
- โปรแกรมด้านล่างมี ทุก ส่วนที่ต้องการ อ่านคำอธิบาย (comments) เพื่อหาแต่ละส่วน
- มันใช้ลิสต์ที่ตายตัว (fixed list) ทำให้รันผลลัพธ์เดิมทุกครั้ง (ไม่ต้องพิมพ์สดในที่นี้)
- รันโปรแกรม แล้วเปลี่ยนข้อมูลและกฎเกณฑ์เพื่อให้เป็น ของคุณเอง
# 1) A LIST that stores many values
scores = [72, 95, 58, 88, 40, 67]
# 2) A PROCEDURE with a PARAMETER, that returns a result
def grade_for(score):
# selection inside the procedure: choose a letter for one score
if score >= 90:
return "A"
elif score >= 70:
return "B"
elif score >= 50:
return "C"
else:
return "F"
# 3) An ALGORITHM: SELECTION (if) INSIDE ITERATION (for loop)
pass_count = 0
for s in scores: # iteration: visit every score
letter = grade_for(s) # call the procedure with a parameter
if letter != "F": # selection: is this a pass?
pass_count = pass_count + 1
print(f"score {s} -> grade {letter}") # output
# More output: a summary
print(f"{pass_count} out of {len(scores)} passed")
Make it your own
- Change the list to your own data (and try a different length).
- Change the procedure: new rule, new parameter name, or return something else.
- Change the algorithm: count something new, or keep only items that pass the
if. - Add input if you like, for example
input("Enter a name: ").
ทำให้เป็นของคุณเอง
- เปลี่ยน ลิสต์ เป็นข้อมูลของคุณเอง (และลองใช้ความยาวที่ต่างกัน)
- เปลี่ยน กระบวนการ: กฏใหม่, ชื่อพารามิเตอร์ใหม่, หรือคืนค่าอื่น
- เปลี่ยน อัลกอริทึม: นับสิ่งใหม่, หรือเก็บเฉพาะไอเท็มที่ผ่าน
if - เพิ่ม อินพุต ได้ตามต้องการ เช่น
input("Enter a name: ")
Written-response prompts
- Answer these about your own program (this is the kind of writing the real task asks for):
- Purpose: What does your program do, and why is it useful?
- List: What does your list store, and how does using one list (instead of many separate variables) make the program simpler to manage?
คำถามสำหรับตอบแบบเขียน
- ตอบคำถามเหล่านี้ เกี่ยวกับโปรแกรมของคุณเอง (นี่คือรูปแบบการเขียนที่งานจริงต้องการ):
- วัตถุประสงค์: โปรแกรมของคุณทำอะไร และทำไมถึง有用的?
- ลิสต์: ลิสต์ของคุณเก็บอะไร และการใช้ลิสต์เดียว (แทนตัวแปรแยกกันหลายตัว) ทำให้โปรแกรม จัดการง่ายขึ้นอย่างไร?
More written-response prompts
- Procedure & parameter: Name your procedure. What is its parameter, and what does the procedure do with it? What does it return?
- Algorithm: Describe the algorithm inside your loop in your own words. Point to where it uses selection (
if) and where it uses iteration (the loop), and say why both are needed.
คำถามสำหรับตอบแบบเขียนเพิ่มเติม
- กระบวนการ & พารามิเตอร์: ตั้งชื่อกระบวนการของคุณ พารามิเตอร์คืออะไร และกระบวนการ ทำอะไร กับมัน? มันคืนค่าอะไร?
- อัลกอริทึม: อธิบายอัลกอริทึม ภายใน ลูปของคุณด้วยภาษาของคุณเอง ชี้ไปที่การใช้ การเลือก (
if) และการใช้ การทำซ้ำ (ลูป) และบอกเหตุผลว่าทำไมทั้งสองอย่างจึงจำเป็น
Rubric checklist
- Tick each item once your program has it:
รายการตรวจสอบเกณฑ์การให้คะแนน
- ทำเครื่องหมายถูกเมื่อโปรแกรมของคุณมีสิ่งนั้นครบ:
[ ] A list (or collection) is used in the program
[ ] A procedure is defined WITH at least one parameter
[ ] That procedure is CALLED somewhere in the program
[ ] The procedure does real work (not empty)
[ ] An algorithm uses selection (if) INSIDE iteration (a loop)
[ ] The program has input and/or output
[ ] I can explain every part in my own words
You can do this
- Start small, run it often, and fix one thing at a time.
- When every box above is ticked, you have the structure the Create Task needs.
- Remember: practice here first, then submit the real task through the AP Digital Portfolio.
คุณทำได้
- เริ่มจากเล็ก รันบ่อยๆ และแก้ทีละจุด
- เมื่อทำเครื่องหมายถูกทุกช่องข้างต้น คุณจะมีโครงสร้างที่งานสร้างต้องการ
- จำไว้: ฝึกที่นี่ก่อน แล้วส่งงานจริงผ่าน AP Digital Portfolio
Common mistakes
- Plan the program's purpose first, then build in small tested pieces.
- Be ready to explain what each part of your code does.
ข้อผิดพลาดที่พบบ่อย
- วางแผนวัตถุประสงค์ของโปรแกรมก่อน แล้วสร้างทีละส่วนทดสอบให้สำเร็จ
- เตรียมพร้อมที่จะอธิบายว่าโค้ดแต่ละส่วนทำอะไร
Now you try
- A warm-up: assemble the required parts once, using the scaffold's example data.
- Press Check answer to confirm every required part is there.
ลองดูเลย
- อบอุ่นร่างกาย: รวบรวมส่วนประกอบที่จำเป็นครั้งเดียว โดยใช้ข้อมูลจากโครงร่างของตัวอย่าง
- กด Check answer เพื่อยืนยันว่ามีส่วนที่ต้องการครบถ้วน
A warm-up that uses the scaffold's example data. (1) Keep the list scores. (2) Define grade_for(score) (one parameter) returning "A"/"B"/"C"/"F" by the rules above (>= 90, >= 70, >= 50, else "F"). (3) With selection (if) inside a loop over scores, count how many pass (grade is not "F") into pass_count. (4) print a summary line. · การอุ่นเครื่องที่ใช้ตัวอย่างข้อมูลจากโครงร่างช่วย (1) รักษา รายการ scores ไว้ (2) นิยาม grade_for(score) (พารามิเตอร์หนึ่งตัว) โดยคืนค่า "A"/"B"/"C"/"F" ตามกฎข้างต้น (>= 90, >= 70, >= 50, อื่นๆ "F") (3) ใช้การเลือก (if) ภายในลูปบน scores, นับจำนวนคนที่ ผ่าน (เกรดไม่ "F") ลงใน pass_count (4) print บรรทัดสรุป
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
The Create task also needs an algorithm you built yourself. Write top_score(scores) that returns the highest value using a loop — start with the first score, then compare each one. Do not use the built-in max. Then print the result. · งานสร้างยังต้องการ อัลกอริทึม ที่คุณสร้างเอง เขียน top_score(scores) ที่คืนค่า ค่าสูงสุด โดยใช้ลูป — เริ่มด้วยคะแนนแรก แล้วเปรียบเทียบแต่ละคะแนน อย่า ใช้ฟังก์ชัน built-in max จากนั้น print ผลลัพธ์
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่