public void streamAssessmentResult( final CandidateEvent candidateEvent, final OutputStream outputStream) { /* Generate result Object from current state */ final AssessmentResult assessmentResult = computeAssessmentResult(candidateEvent); /* Send result */ qtiSerializer.serializeJqtiObject(assessmentResult, outputStream); }
private void storeResultFile(final CandidateSession candidateSession, final QtiNode resultNode) { final File resultFile = getResultFile(candidateSession); FileOutputStream resultStream = null; try { resultStream = new FileOutputStream(resultFile); qtiSerializer.serializeJqtiObject(resultNode, new FileOutputStream(resultFile)); } catch (final Exception e) { throw QtiWorksRuntimeException.unexpectedException(e); } finally { ServiceUtilities.ensureClose(resultStream); } }