Skip to content

Commit

Permalink
feat(excel): add option to disable feedback (#1703)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 authored Nov 18, 2024
1 parent 4130640 commit d67f462
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object MediaInformation {
}
}

case class ExcelMediaInformationTasks(tasks: List[ExcelMediaInformation], enableExperimentalFeatures: Boolean = false)
case class ExcelMediaInformationTasks(tasks: List[ExcelMediaInformation], enableExperimentalFeatures: Boolean = false, disableFeedback: Boolean = false)

case class ExcelMediaInformation(sheetIdx: Int, changeFields: List[ExcelMediaInformationChange] = List(),
@deprecated("Use checkFields instead") outputFields: String, checkFields: List[ExcelMediaInformationCheck] = List(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ class ExcelCheckerService extends CheckerService with CheckerServiceOnMainFileUp
"OK"
} else {
val correct = results.count(c => c.success)
val hints = results.zip(excelMediaInformation.tasks)
.filter(t => !t._1.success)
.map(t => buildTaskResultText(t._1, t._2))
.mkString("\n")
val hints = if (!excelMediaInformation.disableFeedback) {
results.zip(excelMediaInformation.tasks)
.filter(t => !t._1.success)
.map(t => buildTaskResultText(t._1, t._2))
.mkString("\n")
} else {""}
val res = f"$correct von ${results.length} Unteraufgaben richtig."

if (hints.nonEmpty) {
Expand Down

0 comments on commit d67f462

Please sign in to comment.