SEBSERV-354 fixed
This commit is contained in:
		
							parent
							
								
									6a4924d169
								
							
						
					
					
						commit
						019f9e1421
					
				
					 3 changed files with 12 additions and 11 deletions
				
			
		| 
						 | 
					@ -35,7 +35,7 @@ public interface SEBRestrictionAPI {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /** Use this to check if there is a SEB restriction available on the LMS for the specified exam.
 | 
					    /** Use this to check if there is a SEB restriction available on the LMS for the specified exam.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * A SEB Restriction is available if there it can get from LMS and if there is either a Config-Key
 | 
					     * A SEB Restriction is available if it can get from LMS and if there is either a Config-Key
 | 
				
			||||||
     * or a BrowserExam-Key set or both. If none of this keys is set, the SEB Restriction is been
 | 
					     * or a BrowserExam-Key set or both. If none of this keys is set, the SEB Restriction is been
 | 
				
			||||||
     * considered to not set on the LMS.
 | 
					     * considered to not set on the LMS.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -197,6 +197,7 @@ public class SEBRestrictionServiceImpl implements SEBRestrictionService {
 | 
				
			||||||
        log.info("ExamStartedEvent received, process applySEBClientRestriction...");
 | 
					        log.info("ExamStartedEvent received, process applySEBClientRestriction...");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        applySEBClientRestriction(event.exam)
 | 
					        applySEBClientRestriction(event.exam)
 | 
				
			||||||
 | 
					                .flatMap(e -> this.examDAO.setSEBRestriction(e.id, true))
 | 
				
			||||||
                .onError(error -> log.error(
 | 
					                .onError(error -> log.error(
 | 
				
			||||||
                        "Failed to apply SEB restrictions for started exam: {}",
 | 
					                        "Failed to apply SEB restrictions for started exam: {}",
 | 
				
			||||||
                        event.exam,
 | 
					                        event.exam,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -129,11 +129,12 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // generate the new Config Key and update the Config Key within the LMSSetup API for each exam (delete old Key and add new Key)
 | 
					            // generate the new Config Key and update the Config Key within the LMSSetup API for each exam (delete old Key and add new Key)
 | 
				
			||||||
            for (final Exam exam : exams) {
 | 
					            for (final Exam exam : exams) {
 | 
				
			||||||
                if (exam.getStatus() == ExamStatus.RUNNING || this.examAdminService.isRestricted(exam).getOr(false)) {
 | 
					                if (exam.getStatus() == ExamStatus.RUNNING) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    this.examUpdateHandler
 | 
					                    this.examUpdateHandler
 | 
				
			||||||
                            .getSEBRestrictionService()
 | 
					                            .getSEBRestrictionService()
 | 
				
			||||||
                            .applySEBClientRestriction(exam)
 | 
					                            .applySEBClientRestriction(exam)
 | 
				
			||||||
 | 
					                            .flatMap(e -> this.examDAO.setSEBRestriction(e.id, true))
 | 
				
			||||||
                            .onError(t -> log.error("Failed to update SEB Client restriction for Exam: {}", exam, t));
 | 
					                            .onError(t -> log.error("Failed to update SEB Client restriction for Exam: {}", exam, t));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -201,15 +202,14 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
 | 
				
			||||||
                            .getOrThrow();
 | 
					                            .getOrThrow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // update seb client restriction if the feature is activated for the exam
 | 
					                    // update seb client restriction if the feature is activated for the exam
 | 
				
			||||||
                    if (this.examAdminService.isRestricted(exam).getOr(false)) {
 | 
					 | 
				
			||||||
                    this.examUpdateHandler
 | 
					                    this.examUpdateHandler
 | 
				
			||||||
                            .getSEBRestrictionService()
 | 
					                            .getSEBRestrictionService()
 | 
				
			||||||
                            .applySEBClientRestriction(exam)
 | 
					                            .applySEBClientRestriction(exam)
 | 
				
			||||||
 | 
					                            .flatMap(e -> this.examDAO.setSEBRestriction(e.id, true))
 | 
				
			||||||
                            .onError(t -> log.error(
 | 
					                            .onError(t -> log.error(
 | 
				
			||||||
                                    "Failed to update SEB Client restriction for Exam: {}",
 | 
					                                    "Failed to update SEB Client restriction for Exam: {}",
 | 
				
			||||||
                                    exam,
 | 
					                                    exam,
 | 
				
			||||||
                                    t));
 | 
					                                    t));
 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // flush the exam cache. If there was an error during flush, it is logged but this process goes on
 | 
					                    // flush the exam cache. If there was an error during flush, it is logged but this process goes on
 | 
				
			||||||
                    // and the saved changes are not rolled back
 | 
					                    // and the saved changes are not rolled back
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue