Program: 69407
Project: 69407
Buggy source:
/** 
 * @param ureq
 * @param wControl
 * @param listener If the listener is null, the controller will use the default listener which save the score and pass in assessment entry
 * @param testEntry
 * @param entry
 * @param subIdent
 * @param deliveryOptions
 * @param showCloseResults set to false prevent the close results button to appears (this booleandon't change the settings to show or not the results at the end of the test)
 * @param authorMode if true, the database objects are not counted and can be deleted without warning
 */
public AssessmentTestDisplayController(UserRequest ureq,WindowControl wControl,OutcomesListener listener,RepositoryEntry testEntry,RepositoryEntry entry,String subIdent,QTI21DeliveryOptions deliveryOptions,boolean showCloseResults,boolean authorMode,boolean anonym){
  super(ureq,wControl);
  this.entry=entry;
  this.subIdent=subIdent;
  this.testEntry=testEntry;
  this.outcomesListener=listener;
  this.deliveryOptions=deliveryOptions;
  this.showCloseResults=showCloseResults;
  UserSession usess=ureq.getUserSession();
  if (usess.getRoles().isGuestOnly() || anonym) {
    this.anonym=anonym;
    assessedIdentity=null;
    anonymousIdentifier=getAnonymousIdentifier(usess);
  }
 else {
    this.anonym=anonym;
    assessedIdentity=getIdentity();
    anonymousIdentifier=null;
  }
  FileResourceManager frm=FileResourceManager.getInstance();
  fUnzippedDirRoot=frm.unzipFileResource(testEntry.getOlatResource());
  resolvedAssessmentTest=qtiService.loadAndResolveAssessmentTest(fUnzippedDirRoot,false);
  URI assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  mapperUri=registerCacheableMapper(null,"String_Node_Str" + testEntry.getKey(),new ResourcesMapper(assessmentObjectUri));
  currentRequestTimestamp=ureq.getRequestTimestamp();
  initMarks();
  initOrResumeAssessmentTestSession(ureq,authorMode);
  if (testSessionController.getTestSessionState() != null && testSessionController.getTestSessionState().isEnded()) {
    AssessmentResult assessmentResult=null;
    qtiService.finishTestSession(candidateSession,testSessionController.getTestSessionState(),assessmentResult,ureq.getRequestTimestamp());
    mainVC=createVelocityContainer("String_Node_Str");
  }
 else {
    mainVC=createVelocityContainer("String_Node_Str");
    initQtiWorks(ureq);
  }
  mainPanel=putInitialPanel(mainVC);
  OLATResourceable sessionOres=OresHelper.createOLATResourceableInstance(AssessmentTestSession.class,candidateSession.getKey());
  CoordinatorManager.getInstance().getCoordinator().getEventBus().registerFor(this,getIdentity(),sessionOres);
}

Fixed version (ground truth):
/** 
 * @param ureq
 * @param wControl
 * @param listener If the listener is null, the controller will use the default listener which save the score and pass in assessment entry
 * @param testEntry
 * @param entry
 * @param subIdent
 * @param deliveryOptions
 * @param showCloseResults set to false prevent the close results button to appears (this booleandon't change the settings to show or not the results at the end of the test)
 * @param authorMode if true, the database objects are not counted and can be deleted without warning
 */
public AssessmentTestDisplayController(UserRequest ureq,WindowControl wControl,OutcomesListener listener,RepositoryEntry testEntry,RepositoryEntry entry,String subIdent,QTI21DeliveryOptions deliveryOptions,boolean showCloseResults,boolean authorMode,boolean anonym){
  super(ureq,wControl);
  this.entry=entry;
  this.subIdent=subIdent;
  this.testEntry=testEntry;
  this.outcomesListener=listener;
  this.deliveryOptions=deliveryOptions;
  this.showCloseResults=showCloseResults;
  UserSession usess=ureq.getUserSession();
  if (usess.getRoles().isGuestOnly() || anonym) {
    this.anonym=anonym;
    assessedIdentity=null;
    anonymousIdentifier=getAnonymousIdentifier(usess);
  }
 else {
    this.anonym=anonym;
    assessedIdentity=getIdentity();
    anonymousIdentifier=null;
  }
  FileResourceManager frm=FileResourceManager.getInstance();
  fUnzippedDirRoot=frm.unzipFileResource(testEntry.getOlatResource());
  resolvedAssessmentTest=qtiService.loadAndResolveAssessmentTest(fUnzippedDirRoot,false,false);
  URI assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  mapperUri=registerCacheableMapper(null,"String_Node_Str" + testEntry.getKey(),new ResourcesMapper(assessmentObjectUri));
  currentRequestTimestamp=ureq.getRequestTimestamp();
  initMarks();
  initOrResumeAssessmentTestSession(ureq,authorMode);
  if (testSessionController.getTestSessionState() != null && testSessionController.getTestSessionState().isEnded()) {
    AssessmentResult assessmentResult=null;
    qtiService.finishTestSession(candidateSession,testSessionController.getTestSessionState(),assessmentResult,ureq.getRequestTimestamp());
    mainVC=createVelocityContainer("String_Node_Str");
  }
 else {
    mainVC=createVelocityContainer("String_Node_Str");
    initQtiWorks(ureq);
  }
  mainPanel=putInitialPanel(mainVC);
  OLATResourceable sessionOres=OresHelper.createOLATResourceableInstance(AssessmentTestSession.class,candidateSession.getKey());
  CoordinatorManager.getInstance().getCoordinator().getEventBus().registerFor(this,getIdentity(),sessionOres);
}