Exemple #1
0
     }
 }
 /*--------------------------------------------------------------------
                       CORRECTION OF A WORK
   --------------------------------------------------------------------*/
 /*-----------------------------------
           STEP 2 : check & query
   -------------------------------------*/
 if ($cmd == "exGradeWrk" && isset($_REQUEST['gradedWrkId'])) {
     if (isset($formCorrectlySent) && $formCorrectlySent) {
         $submission->setAssignmentId($assignmentId);
         $submission->setUserId(claro_get_current_user_id());
         $submission->setTitle($wrkForm['wrkTitle']);
         $submission->setAuthor($wrkForm['wrkAuthors']);
         $submission->setVisibility($assignment->getDefaultSubmissionVisibility());
         $submission->setSubmittedText($wrkForm['wrkTxt']);
         $submission->setSubmittedFilename($wrkForm['filename']);
         $submission->setParentId($_REQUEST['gradedWrkId']);
         $submission->setPrivateFeedback($wrkForm['wrkPrivFbk']);
         $submission->setOriginalId($_REQUEST['authId']);
         $submission->setScore($wrkForm['wrkScore']);
         $submission->save();
         $dialogBox->success(get_lang('Feedback added'));
         // notify eventmanager that a new correction has been posted
         $eventNotifier->notifyCourseEvent('work_correction_posted', claro_get_current_course_id(), claro_get_current_tool_id(), $_REQUEST['gradedWrkId'], '0', '0');
         // mail notification if required by configuration
         if (get_conf('mail_notification') && (claro_get_current_course_data('notify_feedbacks') || get_conf('automatic_mail_notification', false))) {
             // get owner(s) email
             $userIdList = array();
             if ($assignment->getAssignmentType() == 'GROUP') {
                 $gradedSubmission = new Submission();