feat: add test mode to quizzes and withhold its solutions

- mode, navigation and max_attempts columns with Go-side defaults
- classes.Withheld gates every solution field of the answer feedback
  and the attempt result while a test attempt is open
- a test's quiz detail lists no questions before the attempt starts
- admin fields and lang keys for the three settings
This commit is contained in:
Jakub Zych
2026-11-09 14:03:34 +01:00
parent 67a83dba32
commit 6c6ecae9d8
14 changed files with 506 additions and 36 deletions

View File

@@ -39,8 +39,12 @@ func TestPluginActivates(t *testing.T) {
if got := len(p.(pact.HasModels).Models()); got != 5 {
t.Errorf("Models = %d, want 5", got)
}
if len(p.(pact.HasMigrations).Migrations()) == 0 {
t.Error("no migrations")
migrations := p.(pact.HasMigrations).Migrations()
if len(migrations) == 0 {
t.Fatal("no migrations")
}
if got := migrations[len(migrations)-1].ID; got != "20261109120000_add_test_mode_to_quizzes" {
t.Errorf("last migration = %s, want 20261109120000_add_test_mode_to_quizzes", got)
}
if app.Config.Bool("golem15.quizzes.scoring.multiple_partial") {
t.Error("scoring.multiple_partial defaults to true, want false")