Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwwdillingham <wwdillingham@sugarlabs.org>2009-08-07 02:17:00 (GMT)
committer wwdillingham <wwdillingham@sugarlabs.org>2009-08-07 02:17:00 (GMT)
commitaf6cda1efb2e1b54e38d198343a20140c6d0decf (patch)
tree7938f8ce247365b4161625d3b452851a199dd3ce
parentdad68a055a3a6a1b2120b4df89ac9b9f1ce1d384 (diff)
checking condition of previous paycase
-rw-r--r--4.N.10_Parser.php23
-rw-r--r--4.N.10_Parser.php~100
2 files changed, 117 insertions, 6 deletions
diff --git a/4.N.10_Parser.php b/4.N.10_Parser.php
index a15dcf4..fa274ec 100644
--- a/4.N.10_Parser.php
+++ b/4.N.10_Parser.php
@@ -81,18 +81,17 @@ for (i=0;i<=$numRecords;i++)
//this if-statement allows us to determine if a student is on his/her second attempt
- if ($attempts[$question_id] == 1)
+ if ($attempts[$question_id] > 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
}
- $previous_response[$question_id] = "c"
+
}
//*****************************CASE: OVERPAID******************************
@@ -107,7 +106,13 @@ for (i=0;i<=$numRecords;i++)
//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")
+ {
+ }
}
@@ -125,7 +130,15 @@ for (i=0;i<=$numRecords;i++)
//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")
+ {
+ }
+
+
}
$previous_response[$question_id] = "u"
diff --git a/4.N.10_Parser.php~ b/4.N.10_Parser.php~
index fd8d2ba..fa274ec 100644
--- a/4.N.10_Parser.php~
+++ b/4.N.10_Parser.php~
@@ -48,6 +48,104 @@ for (i=0;i<=$numRecords;i++)
}
+//in this loop we will cycle through each line of the .dat file and determine at each instance of
+for (i=0;i<=$numRecords;i++)
+{
+ $tok = strtok($lines, " ");
+ //this if-statement allows us to determine if a student is on his/her second attempt
+ if ($attempts[$question_id] == 1)
+ {
+
+ }
+ while ($tok !== false)
+ {
+ $student_id = $tok[0];
+ $question_id = $tok[1];
+ $correct_sum = $tok[2];
+ $submitted_sum = $tok[3];
+ $correct = $tok[4];
+
+ //Need to associate question_id with student
+ $whose_question[$question_id] = $student_id;
+
+ //Need to determine which attempt this is for this particular question
+ $attempts[$question_id]++;
+
+ //*****************************Case: Correct Submission ******************************
+ //How many correct submissions are there - important for determining percentages for yes/no
+ if ($submitted_sum == $correct_sum)
+ {
+ $student_num_correct[$student_id]++;
+ $question_num_correct[$question_id]++;
+
+
+
+ //this if-statement allows us to determine if a student is on his/her second attempt
+ if ($attempts[$question_id] > 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
+
+ }
+
+
+ }
+
+ //*****************************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")
+ {
+ }
+ }
+
+
+ $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")
+ {
+
+ }
+ elseif($previous_response[$question_id] == "o")
+ {
+ }
+
+
+ }
+ $previous_response[$question_id] = "u"
+ }
+
+
+ }
+}
-?> \ No newline at end of file
+?>