コード例 #1
0
 /**
  * Close a Paper that is not finished (because the Exercise does not allow interruption).
  *
  * @param Paper $paper
  */
 public function closePaper(Paper $paper)
 {
     if (!$paper->getEnd()) {
         $paper->setEnd(new \DateTime());
     }
     $paper->setInterupt(true);
     // keep track that the user has not finished
     $paper->setScore($this->calculateScore($paper->getId()));
     $this->om->flush();
     $this->checkPaperEvaluated($paper);
 }