fix: improve canvas export
This commit is contained in:
+14
-2
@@ -39,12 +39,24 @@ pub(crate) fn export(cli: &Cli, sub: &ExportCommand) -> Result<Outcome> {
|
||||
let opts = qti::QtiOptions {
|
||||
form: form.clone(),
|
||||
include_feedback: !no_feedback,
|
||||
shuffle_in_canvas: record.assessment.shuffle.unwrap_or(false),
|
||||
attempts: record.assessment.attempts.unwrap_or(1),
|
||||
shuffle_in_canvas: record.assessment.shuffle.unwrap_or(true),
|
||||
// No per-assessment attempts value falls back to unlimited, the
|
||||
// same default `QtiOptions::default()` carries. Keeping this in
|
||||
// step with the struct default avoids a record without an
|
||||
// `attempts:` silently becoming single-attempt here while the
|
||||
// library considers the default to be unlimited.
|
||||
attempts: record.assessment.attempts.unwrap_or(-1),
|
||||
scoring_policy: record
|
||||
.assessment
|
||||
.scoring_policy
|
||||
.unwrap_or(coursebank::assessment::ScoringPolicy::KeepHighest),
|
||||
// The remaining fields drive `assessment_meta.xml` (quiz type,
|
||||
// results visibility, correct-answer display, one-question-at-a-
|
||||
// time, timing, publish state). This command exposes no flags for
|
||||
// them yet, so take the library defaults: a formative graded quiz
|
||||
// that lets students review responses and the correct answer, and
|
||||
// imports unpublished.
|
||||
..qti::QtiOptions::default()
|
||||
};
|
||||
let package = qti::build(&catalog, &record, &opts)?;
|
||||
let path = out
|
||||
|
||||
Reference in New Issue
Block a user