Skip to content
Browse files

Work in progress on results for summer 2012 experiment.

Determine when learning ocurred and how much learning occurred in
each of the two experimental conditions.
  • Loading branch information...
1 parent 933f3db commit ef48443aac9eadbeb83cc8c3d7a496da1b0928f2 @bvds committed
View
23 LogProcessing/CognitiveModels/condition.php
@@ -4,20 +4,21 @@
// for machined learned help experiment.
class experiment_condition {
-
- public $problems=array();
- public $tID=array();
-
+
+ private $problems=array();
+
function get_conditions($section_r){
- $query = "SELECT userSection,userName,tID,value FROM OPEN_STUDENT_STATE where property='experiment-problems' and userSection REGEXP '$section_r' and model='server'";
+ $query = "SELECT userSection,userName,value FROM OPEN_STUDENT_STATE where property='experiment-problems' and userSection REGEXP '$section_r' and model='server'";
$result = mysql_query($query);
while ($myrow = mysql_fetch_array($result)) {
- $this->problems[$myrow['userSection']][$myrow['userName']]=
- explode(' ',trim($myrow['value'],'() '));
- $this->tID[$myrow['userSection']][$myrow['userName']]=$myrow['tID'];
- // echo "got this: " . $this->tID[$myrow['userSection']][$myrow['userName']] . "\n";
- // print_r($this->problems[$myrow['userSection']][$myrow['userName']]);
- }
+ foreach(explode(' ',trim($myrow['value'],'()')) as $prob){
+ $this->problems[$myrow['userSection']][$myrow['userName']][strtolower(trim($prob))]=1;
+ }
+ }
+ }
+
+ function inExperiment($section, $user, $problem){
+ return isset($this->problems[$section][$user][$problem]);
}
}
View
36 LogProcessing/CognitiveModels/onelog.php
@@ -279,6 +279,8 @@ function prob_link($turns){
'id' => $a->id,
'clientID' => $clientID,
'tID' => $ttID,
+ // Needed for Summer 2012 experimental conditions
+ 'problem' => $thisProblem,
'dt' => $sessionTime->dt(),
'random-help' => array());
// Determine if there is an associated error.
@@ -646,6 +648,40 @@ function skipKC($kc){
}
}
+// For each Student/KC print out: probability learning occurred
+// during experiment, avg gain, avg steps before learning.
+//
+// Could also do conditional probabilities:
+// Avg number of steps given that learning occurred during experiment
+// etc.
+if(true){
+ // Header
+ echo "\"Section\",\"student\",\"KC\",\"exptProb\",\"avgGain\",\"avgLearnSteps\"\n";
+ foreach ($allKCStudent as $kc => $ss){
+ // none: entries where assigment of blame failed
+ // select-mc-answer answer multiple-choice questions
+ if(skipKC($kc))continue;
+ foreach($ss as $thisSection => $st){
+ foreach($st as $thisName => $opps){
+ $maxv=$model[$kc][$thisSection][$thisName];
+ $learn=0;
+ $jj=0;
+ $eProb=0;
+ // set when turn is defined. All transactions in an
+ // opportunity must occur in the same problem.
+ $thisProb=$opps[0]['problem'];
+ for($k=0; $k<count($opps); $k++){
+ $learn+=$maxv['learnHereProb'][$k]*$maxv['learnGain'][$k];
+ $jj+=$maxv['learnHereProb'][$k]*$k;
+ if($expt->inExperiment($thisSection,$thisName,$thisProb)){
+ $eProb+=$maxv['learnHereProb'][$k];
+ }
+ }
+ echo "\"$thisSection\",\"$thisName\",\"$kc\",$eProb,$learn,$jj\n";
+ }
+ }
+ }
+ }
// For each kc and step, print model parameters, step id (ttID),
// and policies used, in csv format.
View
6 LogProcessing/DataShop/create-xml.php
@@ -5,7 +5,8 @@
// See README file for details
//
// (Sigh) The code that Anirudh wrote contains lots of
- // code duplication.
+ // code duplication. It also duplicates other php code
+ // used to analyze log files.
include 'JSON.php';
$userSection='^asu_7e256268bab914fb5asul1_';
@@ -29,7 +30,8 @@
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
// Get list of problems for Summer 2012 experiment
-$query="SELECT userName,value from OPEN_STUDENT_STATE where userSection REGEXP '$userSection' and property='EXPERIMENT-PROBLEMS'";
+// See condtion.php
+$query="SELECT userName,value from OPEN_STUDENT_STATE where userSection REGEXP '$userSection' and property='EXPERIMENT-PROBLEMS' and model='server'";
$experimentProblems=array();
foreach($db->query($query) as $stud){
foreach(explode(' ',trim($stud['value'],'()')) as $prob){
View
BIN LogProcessing/self-improved-tutor/CMU-August-2012.odp
Binary file not shown.

0 comments on commit ef48443

Please sign in to comment.
Something went wrong with that request. Please try again.