예제 #1
0
 public function renderDefault($id)
 {
     $info = $this->courseRegistry;
     $this->deliver($info->unit);
     $this->deliver($info->assignment);
     $this->deliver($info->course);
     if ($info->solution) {
         $this->template->solution = $info->solution;
     }
     $this->template->uploadPath = $this->uploadStorage->path;
     $this->template->reviews = $this->reviewRepository->findByUnitAndReviewer($info->unit, $this->userInfo);
 }
 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');
 }
예제 #3
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');
 }
예제 #4
0
 public function renderObjections($id)
 {
     $this->courseRegistry->insert($this->courseRepository->find($id));
     $this->template->course = $course = $this->courseRegistry->course;
     $this->template->reviews = $this->reviewRepository->findReviewsWithProblemsByCourse($course);
 }