original_string: protected function lookup_choice($choice) {
          if (array_key_exists($choice, $this->choices)) {
              // Easy case: choice is a key in the choices array.
              return $choice;
          } else {
              // But choice can also be the id of a shortanser correct answer
              // without been a key of the choices array, in that case we need
              // to first find the shortanswer id, then find the choices index
              // associated to it.
              $questionid = array_search($choice, $this->rightanswerid);
              if ($questionid) {
                  return $this->right[$questionid];
              }
          }
          return null;
      }
code: protected function lookup_choice($choice) {
          if (array_key_exists($choice, $this->choices)) {
              // Easy case: choice is a key in the choices array.
              return $choice;
          } else {
              // But choice can also be the id of a shortanser correct answer
              // without been a key of the choices array, in that case we need
              // to first find the shortanswer id, then find the choices index
              // associated to it.
              $questionid = array_search($choice, $this->rightanswerid);
              if ($questionid) {
                  return $this->right[$questionid];
              }
          }
          return null;
      }
code_tokens: protected function lookup_choice ( $ choice ) { if ( array_key_exists ( $ choice , $ this -> choices ) ) { // Easy case: choice is a key in the choices array. return $ choice ; } else { // But choice can also be the id of a shortanser correct answer // without been a key of the choices array, in that case we need // to first find the shortanswer id, then find the choices index // associated to it. $ questionid = array_search ( $ choice , $ this -> rightanswerid ) ; if ( $ questionid ) { return $ this -> right [ $ questionid ] ; } } return null ; }
docstring: Find the index corresponding to a choice
  
  @param integer $choice
  @return integer
docstring_tokens: Find the index corresponding to a choice