Skip to content

Commit

Permalink
Prefill new activity with example DoenetML
Browse files Browse the repository at this point in the history
  • Loading branch information
cqnykamp committed Sep 14, 2024
1 parent 6ab52c6 commit b99785e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE `content` MODIFY `id` BINARY(16) NOT NULL DEFAULT (uuid_to_bin(uuid(), 1));

-- AlterTable
ALTER TABLE `documentSubmittedResponses` MODIFY `id` BINARY(16) NOT NULL DEFAULT (uuid_to_bin(uuid(), 1));

-- AlterTable
ALTER TABLE `documents` MODIFY `id` BINARY(16) NOT NULL DEFAULT (uuid_to_bin(uuid(), 1));

-- AlterTable
ALTER TABLE `users` MODIFY `userId` BINARY(16) NOT NULL DEFAULT (uuid_to_bin(uuid(), 1));
5 changes: 4 additions & 1 deletion server/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export async function createActivity(
}
}

const sourcePrefill = `<p>Your content goes here! Example: What is <m>1+1</m>?</p>
<answer>2</answer>`;

const activity = await prisma.content.create({
data: {
ownerId,
Expand All @@ -105,7 +108,7 @@ export async function createActivity(
documents: {
create: [
{
source: "",
source: sourcePrefill,
doenetmlVersionId: defaultDoenetmlVersion.id,
name: "Untitled Document",
},
Expand Down

0 comments on commit b99785e

Please sign in to comment.