­­­An Analysis of Common Errors Leading to Excessive Student Struggle on Homework Problems in an Introductory Programming Course Common errors that lead.

Slides:



Advertisements
Similar presentations
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Advertisements

Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Dr. Yang, Qingxiong (with slides borrowed from Dr. Yuen, Joe) LT4: Control Flow - Loop CS2311 Computer Programming.
Basic Control Structures Control order of execution of statements sequential selection iteration - Repeat some action while a certain condition is true.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
1 Chapter 6 Looping Dale/Weems/Headington. 2 l Physical order vs. logical order l A loop is a repetition control structure based on a condition. l it.
The If/Else Statement, Boolean Flags, and Menus Page 180
EGR 2261 Unit 4 Control Structures I: Selection  Read Malik, Chapter 4.  Homework #4 and Lab #4 due next week.  Quiz next week.
Chapter 5: Control Structures II (Repetition)
CHAPTER 5: CONTROL STRUCTURES II INSTRUCTOR: MOHAMMAD MOJADDAM.
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
Instructors begin using McGraw-Hill’s Homework Manager by creating a unique class Web site in the system. The Class Homepage becomes the entry point for.
COIT29222 Structured Programming Slide 1 COIT29222-Structured Programming Lecture Week 06  Reading: Study Guide Book 2, Modules 9 & 10 Textbook (4 th.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
Student Performance Improvement using Interactive Textbooks: A Three-University Cross-Semester Analysis Alex Edgcomb*, Frank Vahid*, Roman Lysecky°, Andre.
Quiz Answers 1. Show the output from the following code fragment: int a = 5, b = 2, c = 3; cout
Copyright © Nancy Acemian 2004 For Loops-Break-Continue COMP For loop is a counter controlled loop. For loop is a pretest loop. Used when number.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
CSE1222: Lecture 6The Ohio State University1. Common Mistakes with Conditions (1)  Consider the following code: int age(26); if (age = 18) { cout
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 5: Control Structures II (Repetition). Objectives In this chapter, you will: – Learn about repetition (looping) control structures – Learn how.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
CSE1222: Lecture 7The Ohio State University1. logExample.cpp // example of log(k) for k = 1,2,..,8... int main() { cout
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
An Introduction to Programming with C++ Sixth Edition Chapter 14 Sequential Access Files.
Loops Wrap Up 10/21/13. Topics *Sentinel Loops *Nested Loops *Random Numbers.
Programming with Microsoft Visual Basic th Edition
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Section 5 - Arrays. Problem solving often requires information be viewed as a “list” List may be one-dimensional or multidimensional List is implemented.
Conditional Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Quiz 3 is due Friday September 18 th Lab 6 is going to be lab practical hursSept_10/exampleLabFinal/
1 CS161 Introduction to Computer Science Topic #8.
Fundamental Programming Fundamental Programming More on Repetition.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 3 Friday 03 Oct 2014 EGR 115 Introduction to Computing for Engineers.
Chapter 5 Repetition. 2 Objectives You should be able to describe: The while Statement cin within a while Loop The for Statement The do Statement Common.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Chapter 4 Repetition Statements Program Development and Design Using C++, Third Edition.
Chapter 6 Looping. 2 l A loop is a repetition control structure. l it causes a single statement or block to be executed repeatedly What is a loop?
Quest Learning and Assessment Quest is an online homework delivery and grading system created and maintained by the College of Natural Sciences at The.
1 Chapter 4 - Control Statements: Part 1 Outline 4.1 Introduction 4.4 Control Structures 4.5 if Selection Structure 4.6 if/else Selection Structure 4.7.
ALGORITHMS AND FLOWCHARTS
CprE 185: Intro to Problem Solving (using C)
REPETITION CONTROL STRUCTURE
CHAPTER 4 REPETITION CONTROL STRUCTURE / LOOPING
Python: Control Structures
EGR 2261 Unit 4 Control Structures I: Selection
­­­Python Versus C++: An Analysis of Student Struggle on Small Coding Exercises in Introductory Programming Courses Nabeel Alzahrani1, Frank Vahid1,3,
Building Java Programs
Conditions and Ifs BIS1523 – Lecture 8.
How to Create and Start a Test Session
CSC141 Computer Science I Zhen Jiang Dept. of Computer Science
Unary Operators ++ and --
CSC530 Data Structure - Decision
Loops A loop is a repetition control structure.
Coding Concepts (Basics)
Chapter 3: Input/Output
CS150 Introduction to Computer Science 1
CS150 Introduction to Computer Science 1
Boolean Expressions to Make Comparisons
by Joe Michael Allen, Frank Vahid, Kelly Downey, and Alex Edgcomb
Objectives You should be able to describe: The while Statement
An Analysis of Using Many Small Programs in CS1
by Joe Michael Allen, Frank Vahid, Kelly Downey, and Alex Edgcomb
Nabeel Alzahrani1, Frank Vahid1,2, Alex Edgcomb1,2
Coral: An Ultra Simple Language for Learning to Program
Presentation transcript:

­­­An Analysis of Common Errors Leading to Excessive Student Struggle on Homework Problems in an Introductory Programming Course Common errors that lead to excessive struggle in CS1 Nabeel Alzahrani1, Frank Vahid1,3, Alex Edgcomb1,3, Roman Lysecky2,3, and Susan Lysecky3  
 1 Computer Science and Engineering, University of California, Riverside 
 2 Electrical and Computer Engineering, University of Arizona
 3 zyBooks, Los Gatos, California  
 nalza001@ucr.edu, vahid@cs.ucr.edu, aedgcomb@cs.ucr.edu, rlysecky@ece.arizona.edu, susan.lysecky@zybooks.com Nabeel Alzahrani, UC Riverside, 2018 /15

Excessive Struggle: Too many attempts, can demoralize Solving a small coding problem 2-3x healthy 10x or more frustrating  Wrong ”Excessive struggle” Students in CS1 do many coding tasks “Struggle” means the student is having some trouble Some normal (2-3 wrong before right), but excessive not healthy Excessive struggle is one cause of drops and fails Study of 50 universities showed nearly 33% of CS 1 grades are F’s Demoralize / attrition Right *33% mean worldwide fail rate * 54 articles, 51 institutions, 15 countries, 161 CS1 courses Watson, Failure rates in introductory programming revisited, ITiCSE, 2014 (above figure) Nabeel Alzahrani, UC Riverside, 2018 /15

Analyzed struggle on small coding activities (CAs) Results may be used for teacher / content improvement CAs are not programming assignments 10 CAs per week, 100 CAs per quarter ZyBook: online CS1 content, coding activities (CAs), auto-grader, etc. CA Vs. Programming assignments CAs: coding activity missing code snippet, shown in green in the screenshot CAs: takes up to 5 min. and up to 3 attempts in average to be solved Students use the “Run” button, to run the CA (including the missing code snippet they add) against test cases Students can submit solutions as much as they like until the CA is solved or they leave the CA unsolved Teacher only can click “View solution” to see the solution Teacher only can click “Download student submissions” to download the file that log all student submissions for that CA Right-side showed, CAs with their struggle rate Nabeel Alzahrani, UC Riverside, 2018 /15

Nabeel Alzahrani, UC Riverside, 2018 Student submissions Submission time User # Correct? Submitted solution 5/7/2017   11:50:03 PM 0xxxx No for (i=0; i <= numRows; ++i) {   for (j=0; j<= numCols; ++j) {      return static_cast<char>('A' - 1 + i);        cout << i << j;}} ... 11:52:54 PM        cout << i << j << " ";   }} 5/8/2017   12:01:37 AM Yes for (i=1; i <= numRows; ++i) {   for (j=0; j< numCols; ++j) {        cout << i << static_cast<char>('A' + j) << " "; Submissions recorded in a csv file with: timestamp, user id, Correctness (yes/no), code Student submission is csv file with four fields: timestamp, user ID, current answer (Yes/No), and submitted code Teacher can download such file for further analysis and that we did in this paper We downloaded the student submission file for each CA and did the analysis to find the struggle rate for each CA Nabeel Alzahrani, UC Riverside, 2018 /15

Struggle rate as a metric Intuition: Baseline time = average time of top 20% students Baseline attempts = average attempts of top 20% students Struggling if time > 5 min and time > 2 x baseline time And attempts > 3 attempts and time > 2 x baseline attempts The metric struggle based on time and attempts thresholds and baselines Baseline time as average time of top 20% students Baseline attempts as average attempts of top 20% students Time threshold is 5 min Attempts threshold is 3 Nabeel Alzahrani, UC Riverside, 2018 /15

CAs sorted by struggle rate Time or attempts could be due to CA complexity Struggle combines both, with thresholds & baselines (min.) The figure showed CAs sorted by struggle rate Time or attempts by itself could be due to the complexity of the CA, so it is not good indicator of struggle Struggle combines both time and attempts Nabeel Alzahrani, UC Riverside, 2018 /15

The 78 CAs with their struggle rates High: 46% Low: 1% Avg: 12% 78 CAs sorted as they appear in the content The most struggle was 46% and lowest was 1%, averaging 12% Nabeel Alzahrani, UC Riverside, 2018 /15

Common errors leading to struggle % CA name Sample correct code Sample wrong code Common errors yielding struggle 46% 4_2_3_Using_find() if (userInput.find("darn") != string::npos) { cout << "Censored" << endl;} else { cout << userInput << endl; } if (userInput.find("darn")) { cout << "Censored" << endl;    cout << userInput << endl; • Missing if statement condition to check if the word is found or not 5_3_1_Nested _loops_Indent_text for (i = 0; i <= userNum; i++) { for (j = 0; j < i; j++) {     cout << " ";   cout <<  i << endl; for(i = 0; i <= userNum; i++) {   for(j = 0; j <= userNum; j++) {     cout << j << endl;    cout << " "; • Wrong inner loop condition • Wrong cout locations and arguments 40% 5_3_2_Nested _loops_Print_seats for (currRow = 1; currRow <= numRows; currRow = currRow + 1) { currColLet = 'A';   for (currCol = 1; currCol <= numCols; currCol = currCol + 1) {      cout << currRow <<  currColLet << " ";      currColLet = currColLet + 1;  char letter = 'A';  for (i=1;i<=numRows;++i) {      cout << i ;      for (j=0;j<=i;++j){       cout << letter +1 << endl;      }  } • Missing initialization of “letter” in the outer loop. • Wrong initialization of “j” in the inner loop • Wrong condition for inner loop • Missing “letter” increment in the inner loop Find() returns string::npos when not found but it seems most students do not know that Nested loop index coordination with outer loop index and placement of print seems to cause struggle Getting the next letter in a nested loop seems to cause struggle for most students Nabeel Alzahrani, UC Riverside, 2018 /15

Nabeel Alzahrani, UC Riverside, 2018 % CA name Sample correct code Sample wrong code Common errors yielding struggle 37% 4_4_2_Whitespace _replace if (isspace(passCode.at(0))) { passCode.at(0) = '_'; } if (isspace(passCode.at(1))) {   passCode.at(1) = '_'; passCode.replace(0,1,"_"); else if (isspace(passCode.at(1))) {     passCode.replace(1,1,"_"); • Using else if instead of multiple if 5_2_2_rand _function_Seed _and_then_get _random_numbers srand(seedVal); cout << (rand() % 10) << endl; srand(time(0)); cout << (rand() % 9)  << endl; cout << (rand() % 9) << endl; • Using seed of time(0) (taught earlier) rather than obeying the  instruction to use seedVal • Using %9 instead of %10 at() can assign a specific value to a specific location but it seems most students do not know that Seed value seem to cause struggle Nabeel Alzahrani, UC Riverside, 2018 /15

Nabeel Alzahrani, UC Riverside, 2018 % CA name Sample correct code Sample wrong code Common errors yielding struggle 34% 2_11_2_Successive _letters char letterStart;   cin >> letterStart; cout << letterStart; letterStart = letterStart + 1; cout << letterStart << endl; char letterStartA = 'a'; char letterStartB = 'b';  letterStartB = letterStartA + 1;  cout << letterStartA << letterStartB << endl; • Missing cin • Missing cout after cin • Missing incrementing the only variable • Missing printing that variable 9_1_2_Copy_and _modify_vector _elements for (i = 0; i < SCORES_SIZE; ++i) { if (i != (SCORES_SIZE-1)) {      newScores.at(i)= oldScores.at(i+1); } else{ newScores.at(i) =oldScores.at(0); for (i = 0; i < SCORES_SIZE - 1; i++) { newScores.at(0) = oldScores.at(oldScores.size() - 1); newScores.at(i) = oldScores.at(i - 1);  } • Wrong for-loop condition • Missing if statement to update a variable in a loop • Wrong use of vector index to update variable 32% 8_8_2_Resizing _a_vector countDown.resize(newSize); for (i = 0; i < newSize; ++i) {   countDown.at(i) = newSize - i; for(i = 0; i < SCORES_SIZE - 1; i++){ if (i == 0){   newScores.at(i) = • Missing resize of the vector • Wrong condition for the for-loop • Wrong code to change the vector elements Getting the next letter seems to cause struggle for most students Selection inside a loop with string index seems to cause struggle Resize() seems to cause struggle Nabeel Alzahrani, UC Riverside, 2018 /15

Nabeel Alzahrani, UC Riverside, 2018 % CA name Sample correct code Sample wrong code Common errors yielding struggle 28% 5_5_2_Do-while_loop_to_prompt_user_input do {   cout << "Enter a number (<100): \n";   cin >> userInput; } while (!(userInput < 100)); cin >> userInput; cout << "Enter a number (<100): " << endl;  } while (userInput < 100); • Wrong condition 27% 3_5_2_Bool_in _branching _statements if (isBalloon && !isRed) {   cout << "Balloon" << endl; } else if (isBalloon && isRed) {   cout << "Red balloon" << endl; else {   cout << "Not a balloon" << endl; if ( (isBalloon != false) && isRed ) {     cout << "Balloon" << endl;  }  if ((isBalloon = true) && (isRed = true)) {     cout << "Red balloon" << endl;  else { cout << "Not a balloon"<< endl; • Incorrect use of if statement • Incorrect condition for the if statement Using = instead of == Do-while condition seems to cause struggle If-elseif seem to cause struggle Nabeel Alzahrani, UC Riverside, 2018 /15

Common errors Core Specialized Nested loops Else-if vs. multiple if Random range Input/output For loop and vector For loop and if Vector index Negated loop expression Boolean expressions C++ find() function Character increment Random seeding Interventions: Lecture time, better material, student-specific hints (popup), debug examples See the paper for more details Nabeel Alzahrani, UC Riverside, 2018 /15

Reducing struggle One simple approach: Add notes link Adding a note link to a CA seem to help student Nabeel Alzahrani, UC Riverside, 2018 /15

Reducing struggle One simple approach: Add notes link 17% struggle rate decrease Modest decrease; more aggressive approaches needed 10 CAs: frequent questions in the past (not due to struggle rate) Spring 2016: 262 students @ UCR Spring 2017: 75 students @ UCR The note link seems to help reduce struggle by 17% Nabeel Alzahrani, UC Riverside, 2018 /15

Nabeel Alzahrani, UC Riverside, 2018 Conclusions Analyzed struggle for 78 C++ zyBook coding activities (CAs), 9 chapters (~80 students) Struggle rates 10-15%; ~40% for some CAs Summarized common sources of struggle if-if vs. if-else / nested loops / loops with branches / etc. Possible interventions Notes – Had small reduction Lecture time, better material, student-specific hints (popup), debug examples While avoiding excessive help (over-dependency) Average struggle rate is 15% Struggle could be reduced using clear instructions with examples Other intervention could help to reduce struggle Nabeel Alzahrani, UC Riverside, 2018 /15