original_string: public static function adjust_fraction($fraction, $certainty) {
          if ($certainty == -1) {
              // Certainty -1 has never been used in standard Moodle, but is
              // used in Tony-Gardiner Medwin's patches to mean 'No idea' which
              // we intend to implement: MDL-42077. In the mean time, avoid
              // errors for people who have used TGM's patches.
              return 0;
          }
          if ($fraction <= 0.00000005) {
              return self::$wrongscore[$certainty];
          } else {
              return self::$rightscore[$certainty] * $fraction;
          }
      }
code: public static function adjust_fraction($fraction, $certainty) {
          if ($certainty == -1) {
              // Certainty -1 has never been used in standard Moodle, but is
              // used in Tony-Gardiner Medwin's patches to mean 'No idea' which
              // we intend to implement: MDL-42077. In the mean time, avoid
              // errors for people who have used TGM's patches.
              return 0;
          }
          if ($fraction <= 0.00000005) {
              return self::$wrongscore[$certainty];
          } else {
              return self::$rightscore[$certainty] * $fraction;
          }
      }
code_tokens: public static function adjust_fraction ( $ fraction , $ certainty ) { if ( $ certainty == - 1 ) { // Certainty -1 has never been used in standard Moodle, but is // used in Tony-Gardiner Medwin's patches to mean 'No idea' which // we intend to implement: MDL-42077. In the mean time, avoid // errors for people who have used TGM's patches. return 0 ; } if ( $ fraction <= 0.00000005 ) { return self :: $ wrongscore [ $ certainty ] ; } else { return self :: $ rightscore [ $ certainty ] * $ fraction ; } }
docstring: Given a fraction, and a certainty, compute the adjusted fraction.
  @param number $fraction the raw fraction for this question.
  @param int $certainty one of the certainty level constants.
  @return number the adjusted fraction taking the certainty into account.
docstring_tokens: Given a fraction and a certainty compute the adjusted fraction .