Program: 69355
Project: 69355
Buggy source:
@Override public boolean archiveNodeData(Locale locale,ICourse course,ArchiveOptions options,ZipOutputStream exportStream,String charset){
  String repositorySoftKey=(String)getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
  Long courseResourceableId=course.getResourceableId();
  CourseEnvironment courseEnv=course.getCourseEnvironment();
  List<Identity> identities=ScoreAccountingHelper.loadUsers(courseEnv,options);
  UserRequest ureq=new SyntheticUserRequest(identities.get(0),locale,new UserSession());
  Roles roles=new Roles(false,false,false,false,false,false,false);
  ureq.getUserSession().setRoles(roles);
  MediaResource resource;
  try {
    RepositoryEntry re=RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey,true);
    boolean onyx=OnyxModule.isOnyxTest(re.getOlatResource());
    if (onyx) {
      QTIResultManager qrm=QTIResultManager.getInstance();
      List<QTIResultSet> results=qrm.getResultSets(courseResourceableId,getIdent(),re.getKey(),null);
      if (results.size() > 0) {
        OnyxExportManager.getInstance().exportResults(results,exportStream,this);
      }
      return true;
    }
 else     if (ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
      QTI21Service qtiService=CoreSpringFactory.getImpl(QTI21Service.class);
      resource=new QTI21ResultsExportMediaResource(courseEnv,identities,this,qtiService,ureq,exportStream,locale);
      QTI21ArchiveFormat qaf=new QTI21ArchiveFormat(locale,true,true,true);
      RepositoryEntry courseEntry=course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
      qaf.export(courseEntry,getIdent(),re,exportStream);
      return true;
    }
 else {
      resource=new QTI12ResultsExportMediaResource(courseEnv,ureq,identities,this,exportStream);
      String shortTitle=getShortTitle();
      QTIExportManager qem=QTIExportManager.getInstance();
      QTIExportFormatter qef=new QTIExportFormatterCSVType1(locale,"String_Node_Str","String_Node_Str","String_Node_Str",false);
      return qem.selectAndExportResults(qef,courseResourceableId,shortTitle,getIdent(),re,exportStream,"String_Node_Str");
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean archiveNodeData(Locale locale,ICourse course,ArchiveOptions options,ZipOutputStream exportStream,String charset){
  String repositorySoftKey=(String)getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
  Long courseResourceableId=course.getResourceableId();
  CourseEnvironment courseEnv=course.getCourseEnvironment();
  List<Identity> identities=ScoreAccountingHelper.loadUsers(courseEnv,options);
  UserRequest ureq=new SyntheticUserRequest(new TransientIdentity(),locale,new UserSession());
  Roles roles=new Roles(false,false,false,false,false,false,false);
  ureq.getUserSession().setRoles(roles);
  try {
    RepositoryEntry re=RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey,true);
    boolean onyx=OnyxModule.isOnyxTest(re.getOlatResource());
    if (onyx) {
      QTIResultManager qrm=QTIResultManager.getInstance();
      List<QTIResultSet> results=qrm.getResultSets(courseResourceableId,getIdent(),re.getKey(),null);
      if (results.size() > 0) {
        OnyxExportManager.getInstance().exportResults(results,exportStream,this);
      }
      return true;
    }
 else     if (ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
      QTI21Service qtiService=CoreSpringFactory.getImpl(QTI21Service.class);
      new QTI21ResultsExportMediaResource(courseEnv,identities,this,qtiService,ureq,exportStream,locale).prepare(null);
      ;
      QTI21ArchiveFormat qaf=new QTI21ArchiveFormat(locale,true,true,true);
      RepositoryEntry courseEntry=course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
      qaf.export(courseEntry,getIdent(),re,exportStream);
      return true;
    }
 else {
      new QTI12ResultsExportMediaResource(courseEnv,locale,identities,this,exportStream).prepare(null);
      String shortTitle=getShortTitle();
      QTIExportManager qem=QTIExportManager.getInstance();
      QTIExportFormatter qef=new QTIExportFormatterCSVType1(locale,"String_Node_Str","String_Node_Str","String_Node_Str",false);
      return qem.selectAndExportResults(qef,courseResourceableId,shortTitle,getIdent(),re,exportStream,"String_Node_Str");
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return false;
  }
}