//5.N.10 Parser //http://git.sugarlabs.org/projects/teacher-reporting // //Description: /* Select and use appropriate operations (addition, subtraction, multiplication, and division) to solve problems, including those involving money. */ 1) { //the code is looking here if and only if the parser is analyzing a question which he/she //initially got wrong but has now gotten correct //We can assume it was initally wrong because gcompris money cents would not have a second record of a question_id // if it was correct initially. //TODO - determine whether wrong means previously overpaid or previously underpaid //determine subtraction if ($previous_response[$question_id] == "o") // if you previously overpaid { $correct_subtraction[$student_id]++; //The amount of times a student invoked subtractions correctly } } } //*****************************CASE: OVERPAID****************************** //How many times does each student overpay - important for determining subraction understanding if ($submitted_sum > $correct_sum) { $student_num_overpaid[$student_id]++; $question_num_overpaid[$question_id]++; //this if-statement allows us to determine if a student is on his/her second attempt if ($attempts[$question_id] == 1) { if($previous_response[$question_id] == "u") { } elseif($previous_response[$question_id] == "o") { $strikes[$student_id]++; $incorrect_subtraction[$student_id] } } $previous_response[$question_id] = "o" } //******************************Case: Underpaid*********************************** //how many times the student underpaid if($submitted_sum < $correct_sum) { $student_num_underpaid[$student_id]++; $question_num_underpaid[$question_id]++; //this if-statement allows us to determine if a student is on his/her second attempt if ($attempts[$question_id] == 1) { if($previous_response[$question_id] == "u") { $strikes[$student_id]++; } elseif($previous_response[$question_id] == "o") { $incorrect_subtraction[$student_id]++; } } $previous_response[$question_id] = "u" } }//end while() //*******************************************************Output**************************************************** // addition can be determined if a student gets > 70% of the questions correct on their first attempt. // subtraction can be determined if for > 70% of the questions the student initially over-paid, they immediately follow up with a correct payment. // If a student overpays and then increases their payment, or underpays, followed by an even lower payment it can be inferred the student does not // understand the concepts of /ddition or subtraction with money. // * If for > 10% of the questions the student makes this mistake. He or she gets a "no" for addition and subtraction. //****************** Addition Yes / No *************** foreach ($Class as $student) { if( $num_correct[$student] >= ( .7 * ($num_submissions)) { $understands_addition = true; } else { $understands_addition = false; } //*************Subtraction Yes/No ************* if($incorrect_subtraction[$student] / ($correct_subtraction[$student] + $incorrect_subtractions[$student]) <= .70) { $understands_subtraction = "y"; //we cannot use bool as there is a third case of "undetermined" with subtraction. } elseif($incorrect_subtraction[$student] == NULL || $incorrect_subtraction[$student] == 0) { $understands_subtraction = "u" //undetermined } else { $understands_subtraction = "n" } /*************** Strikes ******************* * * If a student overpays and then increases their payment, or underpays, followed by an even lower payment * it can be inferred the student does not understand the concepts of addition or subtraction with money. * If for > 10% of the total question_id's the student makes this mistake. He or she gets a "no" for addition and subtraction. */ if(!($strikes[$student] / $num_questions[$student] <= .10)) { $understands_addition = false; $understands_subtraction = "n"; } } //end foreach } fclose($fp); //close 4.n.10.dat ?>