Enhancing CT Attitudes in Physics Students by Code-based Model-building

Integrating computer science and computational thinking into physics is now standard, yet high school physics courses often lack computer programming in their curriculum. Building interactive models of physical phenomena with code in physics classes can positively influence students’ computational thinking attitudes. The STEMcoding intervention moderately impacted students’ outcome expectancy, a key indicator of future academic and career choices, when they created interactive computer programs aligned with physics concepts. Over a month, students used the STEMcoding platform to build interactive models of physical phenomena in their physics curriculum. The platform minimizes the cognitive load associated with computer programming, allowing students to focus on computational thinking and computer science. Scaffolding techniques, such as minimally working programs, worked examples, and labeled sub-tasks, help students construct physics knowledge while learning fundamental computer science skills. Students became familiar with the Euler-Cromer model paradigm, which introduces concepts like data typing, control structures, iteration, code reuse, function writing, and code commenting. Outcome expectancy was assessed using the Computer Science Attitude Scale for Middle Grades (MG-CS) instrument. The results showed positive gains in outcome expectancy across all ethnic groups and genders, indicating the effectiveness of STEMcoding activities.

Introduction

  • CT is standard in physics, but programming is missing in high school courses.
  • This study tested a CS intervention to improve CT attitudes in students.
  • Students used STEMcoding to create interactive physics models.
  • The platform lowers programming barriers, focusing on CT & CS.
  • Scaffolding techniques support learning physics & CS.
  • The use of Euler-Cromer modeling introduced key CS concepts:
    • Data typing, control structures, iteration, code reuse, functions, commenting, and debugging.
    • Attitude gains were seen in self-efficacy and outcome expectancy when controlling for gender, race, and coding experience.
1Computational Thinking Practices (adapted from Weintrop et al., 2016)

Using CT to Learn Physics

  • Constructing artifacts and knowledge: Constructionism2. (also see Mindstorms at MIT Media Lab)
  • Stating the problem to leverage computing: Computational Thinking3.
  • We can model CT as constructionism.
  • STEMcoding4 uses CS scaffolding:
    • Minimally Working Programs5a
    • Worked Examples5b
    • Subgoal Labeling6
STEMcoding Move The Blob Activity (check out a p5.js example)

Expectancy Value Theory and CT

  • Self-Efficacy (SE): how good you believe you are at something. “I can do this.”7
  • Outcome Expectancy (OE): how much you value a task. “What do I gain?”7
  • Interconnected affective response and evaluation can predict future academic choices.
CT Attitudes Model (SE & OE)7

AP Physics 1 STEMcoding Study

  • A month-long controlled study of 61 physics students at a large urban Texas high school.
  • Student-built physics models with computer programming (p5.js).
  • Measured changes in self-efficacy and outcome expectancy:
    • RQ1: Self-efficacy changes (SE)?
    • RQ2: Outcome expectancy (OE) changes?

Study Demographics

  • Control & Treatment (shown) were very similar.

MG-CS Attitudes Instrument8

  • Middle grades CS attitude scale: This is a 9-item instrument validated to measure attitudes across gender, race, and coding experience.
  • SE mapped to 3 instrument Likert items.
    • I am good at building computer programs.
  • OE mapped to 5 instrument Likert items.
    • When I combine math and science, I can invent more useful computer programs.
    • Designing computer programs will be important for my future work.

STEMcoding Intervention Methodology

  • Intervention: 1-2 hours a week for 5 weeks.
  • Control group: traditional labs (N=22).
  • Treatment group: STEMcoding labs (N=39).
  • Participants completed MG-CS pre- and post-treatment.
  • SE and OE subscale scores were calculated pre- and post-treatment.
  • Reliability was calculated using Cronbach’s α.
  • ANCOVA analysis was performed, controlling for race, gender, and coding experience.

Study Results & Analysis

Instrument Reliability Confirmed

  • MG-CS8 was internally consistent for the study population, α = 0.91.
  • Reliability was consistent pre-and post-treatment.

RQ1: Self-Efficacy Impact Ambiguous

  • No main effect between time and treatment [F(1,56)=0.257,p=0.6].
  • Strong interaction between coding experience and self-efficacy [F(1,56)=17.408,p<0.001] (η2=0.237).
Treatment self-efficacy scores by coding experience

RQ2: Positive Effect on Outcome Expectancy

  • Moderate effect shown on OE over time [F(1,56)=5.214,p=0.026] (η2=0.09).
  • Race is a significant covariate for OE [F(1,56)=5.749,p=0.020] (η2=0.093).
Treatment outcome expectancy by coding experience

References

  • 1Weintrop, D., Beheshti, E., Horn, M., Orton, K., Jona, K., Trouille, L., & Wilensky, U. (2016). Defining Computational Thinking for Mathematics and Science Classrooms. Journal of Science Education and Technology, 25(1), 127–147. https://doi.org/10.1007/s10956-015-9581-5
  • 2Papert, S., & Harel, I. (1991). Constructionism. Ablex Pub. Corp. https://psycnet.apa.org/record/1991-99006-000
  • 3Wing, J. M. (2017). Computational thinking’s influence on research and education for all. Italian Journal of Educational Technology, 25(2), 7–14. https://doi.org/10.17471/2499-4324/922
  • 4Orban, C., Teeling-Smith, R. M., Smith, J. R. H., & Porter, C. D. (2018). A hybrid approach for using programming exercises in introductory physics. ArXiv, 831. https://doi.org/10.1119/1.5058449
  • 5aWeatherford, S., & Chabay, R. (2013). Student predictions of functional but incomplete example programs in introductory calculus-based physics. AIP Conference Proceedings, 1513(January 2013), 42–45. https://doi.org/10.1063/1.4789647 (Minimally-working programs)
  • 5bSkudder, B., & Luxton-Reilly, A. (2014). Worked examples in computer science. Conferences in Research and Practice in Information Technology Series. https://dl.acm.org/doi/10.5555/2667490.2667497 (Worked examples)
  • 6Margulieux, L. E., Morrison, B. B., & Decker, A. (2020). Reducing withdrawal and failure rates in introductory programming with subgoal-labeled worked examples. International Journal of STEM Education, 7(1). https://doi.org/10.1186/s40594-020-00222-7
  • 7Eccles, J. S., & Wigfield, A. (2001). Motivational Beliefs, Values, and Goals. https://doi.org/10.3233/978-1-61499-649-1-87
  • 8Rachmatullah, A., Wiebe, E., Boulden, D., Mott, B., Boyer, K., & Lester, J. (2020). Development and validation of the Computer Science Attitudes Scale for middle school students (MG-CS attitudes). Computers in Human Behavior Reports, 2. https://doi.org/10.1016/j.chbr.2020.100018 

Leave a Reply