Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Last active August 29, 2015 14:18
Show Gist options
  • Save walterdavis/225c35559b8d366b61bc to your computer and use it in GitHub Desktop.
Save walterdavis/225c35559b8d366b61bc to your computer and use it in GitHub Desktop.
private function decode_fluency($record){
$values = array('' => 0, 'none' => 0, 'basic' => 1, 'functional' => 2, 'fluent' = 3);
$read = $values[$record['can_read']];
$write = $values[$record['can_write']];
$speak = $values[$record['can_speak']];
$this->can_read = ($read > 0);
$this->can_write = ($write > 0);
$this->can_speak = ($speak > 0);
$this->can_understand_spoken = ($speak > 2); //speak is fluent
$this->can_peer_review = ($read == 3 && $write >= 2); //read is fluent & write is fluent/functional
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment