karinayuen commited on
Commit
a50108f
·
verified ·
1 Parent(s): 28159a1

Upload constructive-alignment-generator-basic.tsx

Browse files
constructive-alignment-generator-basic.tsx ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from 'react';
2
+ import { Check, RefreshCw } from 'lucide-react';
3
+
4
+ const ConstructiveAlignmentGenerator = () => {
5
+ const [activity, setActivity] = useState({ name: '', types: [], description: '' });
6
+ const [alignment, setAlignment] = useState({ achieve: [], construct: [], achieveExplanation: '', constructExplanation: '' });
7
+ const [output, setOutput] = useState('');
8
+
9
+ const activityTypes = ['solve problems', 'discuss in groups', 'create a project', 'give presentations', 'analyze case studies', 'conduct experiments'];
10
+ const achieveOptions = ['providing hands-on practice', 'encouraging critical thinking', 'allowing for peer learning', 'applying concepts to real-world situations'];
11
+ const constructOptions = ['actively engaging with the material', 'discussing ideas with peers', 'applying concepts in new contexts', 'reflecting on their learning process', 'connecting new information to prior knowledge'];
12
+
13
+ const handleActivityChange = (e) => setActivity({ ...activity, [e.target.name]: e.target.value });
14
+ const handleActivityTypesChange = (type) => {
15
+ setActivity(prev => ({
16
+ ...prev,
17
+ types: prev.types.includes(type) ? prev.types.filter(t => t !== type) : [...prev.types, type]
18
+ }));
19
+ };
20
+ const handleAlignmentChange = (option, category) => {
21
+ setAlignment(prev => ({
22
+ ...prev,
23
+ [category]: prev[category].includes(option) ? prev[category].filter(item => item !== option) : [...prev[category], option]
24
+ }));
25
+ };
26
+ const handleExplanationChange = (e, category) => {
27
+ setAlignment(prev => ({ ...prev, [`${category}Explanation`]: e.target.value }));
28
+ };
29
+
30
+ const generateExplanation = () => {
31
+ const explanation = `
32
+ <h2>Constructive Alignment Explanation</h2>
33
+
34
+ <h3>Learning Activity: "${activity.name}"</h3>
35
+ <p>In this activity, students will ${activity.types.join(', ')}.</p>
36
+ <p>${activity.description}</p>
37
+
38
+ <h3>Alignment Explanation:</h3>
39
+ <h4>a) This activity helps students achieve the ILO by:</h4>
40
+ <ul>
41
+ ${alignment.achieve.map(item => `<li>${item}</li>`).join('')}
42
+ </ul>
43
+ <p>${alignment.achieveExplanation}</p>
44
+
45
+ <h4>b) This activity supports students in constructing knowledge by:</h4>
46
+ <ul>
47
+ ${alignment.construct.map(item => `<li>${item}</li>`).join('')}
48
+ </ul>
49
+ <p>${alignment.constructExplanation}</p>
50
+ `;
51
+ setOutput(explanation);
52
+ };
53
+
54
+ const resetForm = () => {
55
+ setActivity({ name: '', types: [], description: '' });
56
+ setAlignment({ achieve: [], construct: [], achieveExplanation: '', constructExplanation: '' });
57
+ setOutput('');
58
+ };
59
+
60
+ const Section = ({ title, children }) => (
61
+ <div style={{ marginBottom: '30px', background: '#ffffff', padding: '25px', borderRadius: '12px', boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)' }}>
62
+ <h3 style={{ marginTop: 0, color: '#2c3e50', fontSize: '1.5em', marginBottom: '20px' }}>{title}</h3>
63
+ {children}
64
+ </div>
65
+ );
66
+
67
+ const Button = ({ onClick, children, color = '#3498db', icon }) => (
68
+ <button
69
+ onClick={onClick}
70
+ style={{
71
+ padding: '12px 24px',
72
+ fontSize: '16px',
73
+ backgroundColor: color,
74
+ color: 'white',
75
+ border: 'none',
76
+ borderRadius: '6px',
77
+ cursor: 'pointer',
78
+ transition: 'all 0.3s ease',
79
+ display: 'flex',
80
+ alignItems: 'center',
81
+ justifyContent: 'center',
82
+ margin: '10px 0'
83
+ }}
84
+ onMouseOver={(e) => e.target.style.transform = 'translateY(-2px)'}
85
+ onMouseOut={(e) => e.target.style.transform = 'translateY(0)'}
86
+ >
87
+ {icon && <span style={{ marginRight: '10px' }}>{icon}</span>}
88
+ {children}
89
+ </button>
90
+ );
91
+
92
+ const Checkbox = ({ checked, onChange, label }) => (
93
+ <label style={{ display: 'flex', alignItems: 'center', marginBottom: '15px', cursor: 'pointer' }}>
94
+ <div
95
+ style={{
96
+ width: '22px',
97
+ height: '22px',
98
+ border: '2px solid #3498db',
99
+ borderRadius: '4px',
100
+ marginRight: '12px',
101
+ display: 'flex',
102
+ justifyContent: 'center',
103
+ alignItems: 'center',
104
+ backgroundColor: checked ? '#3498db' : 'white',
105
+ transition: 'all 0.2s ease'
106
+ }}
107
+ onClick={onChange}
108
+ >
109
+ {checked && <Check size={16} color="white" />}
110
+ </div>
111
+ <span style={{ fontSize: '16px', color: '#34495e' }}>{label}</span>
112
+ </label>
113
+ );
114
+
115
+ return (
116
+ <div style={{ fontFamily: 'Arial, sans-serif', maxWidth: '800px', margin: '0 auto', padding: '30px', backgroundColor: '#f5f7fa' }}>
117
+ <h1 style={{ textAlign: 'center', color: '#2c3e50', marginBottom: '30px' }}>Constructive Alignment Generator</h1>
118
+
119
+ <div style={{ background: '#ecf0f1', padding: '20px', borderRadius: '8px', marginBottom: '30px' }}>
120
+ <h2 style={{ color: '#34495e', marginTop: 0 }}>Introduction</h2>
121
+ <p style={{ color: '#7f8c8d', lineHeight: '1.6' }}>
122
+ This generator will help you create a constructive alignment explanation for your learning activity.
123
+ Fill in the details about your activity and how it aligns with your Intended Learning Outcomes (ILOs).
124
+ The generator will then produce a formatted explanation that you can use in your lesson plan.
125
+ </p>
126
+ </div>
127
+
128
+ <Section title="1. Learning Activity">
129
+ <input
130
+ type="text"
131
+ placeholder="Activity Name"
132
+ name="name"
133
+ value={activity.name}
134
+ onChange={handleActivityChange}
135
+ style={{ width: '100%', padding: '12px', border: '1px solid #bdc3c7', borderRadius: '6px', marginBottom: '15px', fontSize: '16px' }}
136
+ />
137
+ <p style={{ marginBottom: '15px', color: '#34495e' }}>In this activity, students will:</p>
138
+ {activityTypes.map(type => (
139
+ <Checkbox
140
+ key={type}
141
+ checked={activity.types.includes(type)}
142
+ onChange={() => handleActivityTypesChange(type)}
143
+ label={type}
144
+ />
145
+ ))}
146
+ <textarea
147
+ placeholder="Brief description of the activity"
148
+ name="description"
149
+ value={activity.description}
150
+ onChange={handleActivityChange}
151
+ style={{ width: '100%', height: '100px', padding: '12px', border: '1px solid #bdc3c7', borderRadius: '6px', marginTop: '15px', fontSize: '16px' }}
152
+ />
153
+ </Section>
154
+
155
+ <Section title="2. Alignment Explanation">
156
+ <h4 style={{ color: '#34495e', marginBottom: '15px' }}>a) How this activity helps achieve the ILO:</h4>
157
+ {achieveOptions.map(option => (
158
+ <Checkbox
159
+ key={option}
160
+ checked={alignment.achieve.includes(option)}
161
+ onChange={() => handleAlignmentChange(option, 'achieve')}
162
+ label={option}
163
+ />
164
+ ))}
165
+ <textarea
166
+ placeholder="Additional explanation (Consider: How does this activity directly relate to the ILO? What specific skills or knowledge from the ILO does this activity target?)"
167
+ value={alignment.achieveExplanation}
168
+ onChange={(e) => handleExplanationChange(e, 'achieve')}
169
+ style={{ width: '100%', height: '100px', padding: '12px', border: '1px solid #bdc3c7', borderRadius: '6px', marginTop: '15px', fontSize: '16px' }}
170
+ />
171
+
172
+ <h4 style={{ color: '#34495e', marginTop: '25px', marginBottom: '15px' }}>b) How this activity helps students build their own understanding:</h4>
173
+ {constructOptions.map(option => (
174
+ <Checkbox
175
+ key={option}
176
+ checked={alignment.construct.includes(option)}
177
+ onChange={() => handleAlignmentChange(option, 'construct')}
178
+ label={option}
179
+ />
180
+ ))}
181
+ <textarea
182
+ placeholder="Additional explanation (Consider: How does this activity promote active learning? How does it encourage students to engage deeply with the material?)"
183
+ value={alignment.constructExplanation}
184
+ onChange={(e) => handleExplanationChange(e, 'construct')}
185
+ style={{ width: '100%', height: '100px', padding: '12px', border: '1px solid #bdc3c7', borderRadius: '6px', marginTop: '15px', fontSize: '16px' }}
186
+ />
187
+ </Section>
188
+
189
+ <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '30px' }}>
190
+ <Button onClick={generateExplanation} color="#27ae60">
191
+ Generate Explanation
192
+ </Button>
193
+ <Button onClick={resetForm} color="#e74c3c" icon={<RefreshCw size={18} />}>
194
+ Restart
195
+ </Button>
196
+ </div>
197
+
198
+ {output && (
199
+ <Section title="Generated Explanation">
200
+ <div dangerouslySetInnerHTML={{ __html: output }} style={{ background: 'white', padding: '20px', borderRadius: '8px', boxShadow: 'inset 0 2px 4px rgba(0,0,0,0.1)' }} />
201
+ </Section>
202
+ )}
203
+ </div>
204
+ );
205
+ };
206
+
207
+ export default ConstructiveAlignmentGenerator;