Ejemplo n.º 1
0
 public function reviewCommentFormSucceeded(Form $form, $values)
 {
     $comment = new ReviewComment();
     $comment->comment = $values->comment;
     $comment->review = $this->courseRegistry->review;
     $comment->review_status = $values->reviewStatus;
     $comment->author = $this->userRepository->find($this->user->id);
     $comment->submitted_at = new DateTime();
     $this->reviewCommentRepository->persist($comment);
     $review = $this->courseRegistry->review;
     $review->status = $values->reviewStatus;
     $this->reviewRepository->persist($review);
     $this->logEvent($comment, 'submit');
     $this->redirect('this');
 }
 public function addReviewFormSucceeded(Form $form, $values)
 {
     $reviewer = $this->userRepository->find($values->user_id);
     $solution = $this->courseRegistry->solution;
     $review = $this->reviewRepository->createReview($solution, $reviewer);
     $review->status = Review::PROBLEM;
     $this->reviewRepository->persist($review);
     $comment = new ReviewComment();
     $comment->comment = '<span style="color:#aaa">— ' . $this->translator->translate('messages.review.addedAdHoc') . ' —</span>';
     $comment->review = $review;
     $comment->review_status = $review->status;
     $comment->author = $this->userRepository->find($this->user->id);
     $comment->submitted_at = new DateTime();
     $this->reviewCommentRepository->persist($comment);
     $this->redirect('this');
 }