首页 > 解决方案 > Keystone.js:实现编辑考试和考试问题模型的最佳方式

问题描述

在 Keystone.js 中,很容易添加带有“简单”字段的模型,例如。

Car:
 - registrationNumber
 - model
 - year
 - isAutomatic

对于所有这些字段,将生成一个 [Edit Car] 页面,该页面将包含一个包含所有字段的“表单”。

但是,由于我正在开发具有考试/测验功能的学习系统,因此我需要编辑更复杂的模型 -Exam特别是Questions[].

Exam除之外的所有字段Question都是“简单的”(并且可以在 [Edit Exam] 页面上轻松呈现为可编辑字段)。但是如何为复杂的Question模型提供 UI 呢?

Exam:
  - name
  - durationMinutes
  - welcomeText
  - Questions[]

UI 的主要目的是Questions在一个上下文中进行编辑Exam(因为每个考试最多可以有 100 个问题)。

Question:
 - questionType:single_choice|mutliple_choice|picture|text|longtext)
 - questionText
 - questionChoices[] : string
 - correctAnswer: string
 - explanationTextLong: string

我想知道将这个相关列表Questions编辑器添加到 keystone UI 的最佳方法是什么?

标签: content-management-systemkeystonejs

解决方案


推荐阅读