feat: add support for TABLE_AUTO question type with table input rendering and auto-grading
This commit is contained in:
@@ -14,6 +14,16 @@ class AnswersForm(forms.Form):
|
||||
'placeholder': 'Введите ваш ответ здесь...'
|
||||
})
|
||||
)
|
||||
elif q.question_type == 'TABLE_AUTO':
|
||||
rows = getattr(q, 'table_rows', 2) or 2
|
||||
for i in range(1, rows + 1):
|
||||
for j in range(1, 3):
|
||||
self.fields[f'answer_{q.id}_r{i}_c{j}'] = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.TextInput(attrs={
|
||||
'class': 'w-full px-2 py-1 border rounded focus:outline-none focus:ring-1 focus:ring-blue-500',
|
||||
})
|
||||
)
|
||||
else:
|
||||
self.fields[f'file_{q.id}'] = forms.FileField(
|
||||
label='Прикрепить файл:',
|
||||
|
||||
Reference in New Issue
Block a user