Added get_file method to datasets

This commit is contained in:
viveksantayana committed 2023-03-05 00:26:39 +00:00
1 parent c9ad8e87cd
commit 9a02048199
2 files changed
+8 -5

No files matched your search

+1 -4
View File
@@ -435,10 +435,7 @@ def _view_entry(id:str=None):
flash('Invalid entry ID.', 'error')
return redirect(url_for('admin._view_entries'))
test = entry.test
dataset = test.dataset
dataset_path = dataset.get_file()
with open(dataset_path, 'r') as _dataset:
data = loads(_dataset.read())
data = test.dataset.get_data()
correct = get_correct_answers(dataset=data)
answers = answer_options(dataset=data)
return render_template('/admin/result-detail.html', entry = entry, correct = correct, answers = answers)