Customizable practice tests with various question types
import StudyfetchSDK from '@studyfetch/sdk'; const client = new StudyfetchSDK({ apiKey: 'your-api-key', baseURL: 'https://studyfetchapi.com', }); const testComponent = await client.v1.components.create({ name: 'Biology Midterm Practice', type: 'practice_test', config: { materials: ['mat-123', 'mat-456'], folders: ['folder-789'], questionTypes: ['multiplechoice', 'truefalse', 'shortanswer'], questionsPerTest: 25, difficulty: 'medium', timeLimit: 45, showCorrectAnswers: true, randomizeQuestions: true, allowRetakes: true, passingScore: 75 } }); console.log('Practice test component created:', testComponent._id);
"practice_test"
Show Configuration Properties
multiplechoice
truefalse
essay
shortanswer
fillintheblanks
easy
medium
hard
{ "_id": "comp_789ghi", "name": "Biology Midterm Practice", "type": "practice_test", "status": "active", "config": { "materials": ["mat-123", "mat-456"], "folders": ["folder-789"], "questionTypes": ["multiplechoice", "truefalse", "shortanswer"], "questionsPerTest": 25, "difficulty": "medium", "timeLimit": 45, "showCorrectAnswers": true, "randomizeQuestions": true, "allowRetakes": true, "passingScore": 75 }, "createdAt": "2024-01-15T10:00:00Z", "updatedAt": "2024-01-15T10:00:00Z", "organizationId": "org_456def", "statistics": { "totalAttempts": 0, "averageScore": null } }
const embedResponse = await client.v1.components.generateEmbed(testComponent._id, { // User tracking userId: 'user-456', groupIds: ['class-101', 'class-102'], sessionId: 'session-789', // Practice Test-specific features features: { enableHistory: true }, // Dimensions width: '100%', height: '700px', // Token expiry expiryHours: 24 });
<iframe src="https://embed.studyfetch.com/component/comp_789ghi?token=..." width="100%" height="700px" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 8px;"> </iframe>
Was this page helpful?