private static void GenerateGeneralInfo(StringBuilder htmlStringBuilder,EvaluationPlatformDomain.Models.Evaluation evaluation) { htmlStringBuilder.AppendLine($@" <div style='width: 100%; page-break-after:always'> <div> <h3 style=' text-align: center'>{evaluation.Student.Person.FirstName} {evaluation.Student.Person.LastName}</h3> <h4>Evaluatie: {evaluation.Description}</h4> <span style='float:right'>Datum: {evaluation.EvaluationDate.ToShortDateString()}</span> <span style='float:left'>Vak: {evaluation.Course.Description}</span> </div> "); }
private static void GenerateTable(StringBuilder htmlStringBuilder, EvaluationPlatformDomain.Models.Evaluation evaluation) { htmlStringBuilder.AppendLine($@" <table style='width:100%'> <thead> <tr> <th class='columnDescription'>Omschrijving: {evaluation.Description}</th> <th class='columnScore'>Score</th> <th class='columnNote'></th> </tr> </thead> <tbody> "); GenerateSubsections(htmlStringBuilder, evaluation); htmlStringBuilder.AppendLine($@" </tbody> </table> <div style='float:right'>Score: {evaluation.Result.Total.ToString("F")}</div> <div> </div> <div><b>Opmerking:</b> {evaluation.GeneralComment}</div> </div>"); }
private static void GenerateSubsections(StringBuilder htmlStringBuilder, EvaluationPlatformDomain.Models.Evaluation evaluation) { foreach (var subsection in evaluation.EvaluationTemplate.EvaluationSubSections.OrderByDescending(e => e.SequenceNumber)) { htmlStringBuilder.AppendLine($@" <tr> <td colspan='3' class='columnDescription category'>{subsection.Description}: {subsection.Weight}%</td> </tr> "); GenerateEvaluationItemRows(htmlStringBuilder, evaluation.EvaluationItems.Where(e => e.EvaluationSubSection.Id == subsection.Id)); decimal subsectionResult; string resAsString = string.Empty; if (evaluation.Result.TotalsPercategory.TryGetValue(subsection.Id, out subsectionResult)) { resAsString = subsectionResult.ToString("F"); } htmlStringBuilder.AppendLine($@" <tr> <td class='columnDescription'></td> <td class='columnScore' colspan='2'>Totaal: {resAsString}</td> </tr> "); } }