mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
updated quiz form edtor
This commit is contained in:
@@ -45,6 +45,7 @@ public class QuizEditorContext
|
||||
.ToArray();
|
||||
|
||||
planner.LocalCourse = planner.LocalCourse with { Modules = updatedModules };
|
||||
Quiz = newQuiz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,16 +22,16 @@ public static class SubmissionType
|
||||
public static readonly string NONE = "none";
|
||||
public static readonly IEnumerable<string> AllTypes = new string[]
|
||||
{
|
||||
SubmissionType.ONLINE_TEXT_ENTRY,
|
||||
SubmissionType.ONLINE_UPLOAD,
|
||||
SubmissionType.ONLINE_QUIZ,
|
||||
SubmissionType.ON_PAPER,
|
||||
SubmissionType.DISCUSSION_TOPIC,
|
||||
SubmissionType.EXTERNAL_TOOL,
|
||||
SubmissionType.ONLINE_URL,
|
||||
SubmissionType.MEDIA_RECORDING,
|
||||
SubmissionType.STUDENT_ANNOTATION,
|
||||
SubmissionType.NONE,
|
||||
ONLINE_TEXT_ENTRY,
|
||||
ONLINE_UPLOAD,
|
||||
ONLINE_QUIZ,
|
||||
ON_PAPER,
|
||||
DISCUSSION_TOPIC,
|
||||
EXTERNAL_TOOL,
|
||||
ONLINE_URL,
|
||||
MEDIA_RECORDING,
|
||||
STUDENT_ANNOTATION,
|
||||
NONE,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
namespace LocalModels;
|
||||
|
||||
public record LocalQuiz
|
||||
{
|
||||
public string Id { get; init; } = ""; public ulong? CanvasId { get; init; } = null;
|
||||
public string Id { get; init; } = "";
|
||||
public ulong? CanvasId { get; init; } = null;
|
||||
public string Name { get; init; } = "";
|
||||
public string Description { get; init; } = "";
|
||||
public bool LockAtDueDate { get; init; }
|
||||
@@ -9,5 +12,6 @@ public record LocalQuiz
|
||||
public bool ShuffleAnswers { get; init; }
|
||||
public bool OneQuestionAtATime { get; init; }
|
||||
public int AllowedAttempts { get; init; }
|
||||
//quiz type
|
||||
}
|
||||
public IEnumerable<LocalQuizQuestion> Questions { get; init; } =
|
||||
Enumerable.Empty<LocalQuizQuestion>();
|
||||
}
|
||||
|
||||
28
Management/Models/Local/LocalQuizQuestion.cs
Normal file
28
Management/Models/Local/LocalQuizQuestion.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace LocalModels;
|
||||
|
||||
public record LocalQuizQuestion
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string Text { get; init; } = string.Empty;
|
||||
public string QuestionType { get; init; } = string.Empty;
|
||||
public int Points { get; init; }
|
||||
public IEnumerable<LocalQuizQuestionAnswer> Answers { get; init; } =
|
||||
Enumerable.Empty<LocalQuizQuestionAnswer>();
|
||||
}
|
||||
|
||||
public static class QuestionType
|
||||
{
|
||||
public static readonly string MULTIPLE_ANSWERS = "multiple_answers";
|
||||
public static readonly string MULTIPLE_CHOICE = "multiple_choice";
|
||||
public static readonly string ESSAY = "essay";
|
||||
public static readonly string SHORT_ANSWER = "short_answer";
|
||||
|
||||
// possible support for: calculated, file_upload, fill_in_multiple_blanks, matching, multiple_dropdowns, numerical, text_only, true_false,
|
||||
public static readonly IEnumerable<string> AllTypes = new string[]
|
||||
{
|
||||
MULTIPLE_ANSWERS,
|
||||
MULTIPLE_CHOICE,
|
||||
ESSAY,
|
||||
SHORT_ANSWER,
|
||||
};
|
||||
}
|
||||
10
Management/Models/Local/LocalQuizQuestionAnswer.cs
Normal file
10
Management/Models/Local/LocalQuizQuestionAnswer.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace LocalModels;
|
||||
|
||||
public record LocalQuizQuestionAnswer
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
//correct gets a weight of 100 in canvas
|
||||
public bool Correct { get; init; }
|
||||
public string Text { get; init; } = string.Empty;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public class YamlManager
|
||||
{
|
||||
public string CourseToYaml(LocalCourse course)
|
||||
{
|
||||
var serializer = new SerializerBuilder().Build();
|
||||
var serializer = new SerializerBuilder().DisableAliases().Build();
|
||||
var yaml = serializer.Serialize(course);
|
||||
|
||||
return yaml;
|
||||
|
||||
Reference in New Issue
Block a user