original_string: public function duplicate_rule($finalcourseid) {
          $rule = fullclone($this->rule);
          unset($rule->id);
          $rule->courseid = $finalcourseid;
          $time = time();
          $rule->timecreated = $time;
          $rule->timemodified = $time;
          rule_manager::add_rule($rule);
      }
code: public function duplicate_rule($finalcourseid) {
          $rule = fullclone($this->rule);
          unset($rule->id);
          $rule->courseid = $finalcourseid;
          $time = time();
          $rule->timecreated = $time;
          $rule->timemodified = $time;
          rule_manager::add_rule($rule);
      }
code_tokens: public function duplicate_rule ( $ finalcourseid ) { $ rule = fullclone ( $ this -> rule ) ; unset ( $ rule -> id ) ; $ rule -> courseid = $ finalcourseid ; $ time = time ( ) ; $ rule -> timecreated = $ time ; $ rule -> timemodified = $ time ; rule_manager :: add_rule ( $ rule ) ; }
docstring: Api to duplicate a rule in a given courseid.
  
  @param int $finalcourseid Final course id.
docstring_tokens: Api to duplicate a rule in a given courseid .