Spaces:
Sleeping
Sleeping
togokah
commited on
Commit
•
861e39c
1
Parent(s):
85c4b9b
Save always
Browse files
pages/2_👨🏫_Начало_работы.py
CHANGED
@@ -230,16 +230,15 @@ if st.session_state.get('-LOGGED_IN_BOOL-'):
|
|
230 |
PROGRESS_BAR.progress(100)
|
231 |
PROGRESS_BAR_S.progress(100)
|
232 |
LOGS.success('**Все готово! Готовые задания и/или онлайн-тест доступны в соответствующих вкладках.**')
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
distractor_model=DISTRACTOR_MODEL)
|
243 |
|
244 |
PROGRESS_BAR = ''
|
245 |
PROGRESS_BAR_S = ''
|
|
|
230 |
PROGRESS_BAR.progress(100)
|
231 |
PROGRESS_BAR_S.progress(100)
|
232 |
LOGS.success('**Все готово! Готовые задания и/или онлайн-тест доступны в соответствующих вкладках.**')
|
233 |
+
save_data_in_database(
|
234 |
+
user_task_database=user_save_text_table,
|
235 |
+
save_type='download',
|
236 |
+
save_name=USER__SAVE_IN_CLOUD_FILE_NAME,
|
237 |
+
cefr_level=CEFR_TEXT_LEVEL,
|
238 |
+
time_stamp=str(datetime.datetime.now())[:-7],
|
239 |
+
creator_name=st.session_state.get('-USER_NAME-'),
|
240 |
+
generated_result=__TASK_DATA__,
|
241 |
+
distractor_model=DISTRACTOR_MODEL, allow=SAVE_IN_CLOUD)
|
|
|
242 |
|
243 |
PROGRESS_BAR = ''
|
244 |
PROGRESS_BAR_S = ''
|
utilities_database/user_database_utils.py
CHANGED
@@ -192,7 +192,7 @@ def check_current_passwd(user_log_in_database, email_reset_passwd: str, current_
|
|
192 |
|
193 |
def save_data_in_database(user_task_database, save_type, save_name, cefr_level, time_stamp, creator_name=None,
|
194 |
generated_result=None, test_taker_name=None, test_taker_answers=None, test_taker_result=None,
|
195 |
-
comments=None, distractor_model=None):
|
196 |
already_saved_names = user_task_database.fetch({'creator_name': creator_name,
|
197 |
'save_name': save_name,
|
198 |
'cefr_level': cefr_level}).items
|
@@ -235,7 +235,8 @@ def save_data_in_database(user_task_database, save_type, save_name, cefr_level,
|
|
235 |
'comments': comments}
|
236 |
user_task_database.put(new_save_data)
|
237 |
if save_type == 'download':
|
238 |
-
|
|
|
239 |
elif save_type == 'online_test':
|
240 |
return st.success('Ответы успешно сохранены!')
|
241 |
|
|
|
192 |
|
193 |
def save_data_in_database(user_task_database, save_type, save_name, cefr_level, time_stamp, creator_name=None,
|
194 |
generated_result=None, test_taker_name=None, test_taker_answers=None, test_taker_result=None,
|
195 |
+
comments=None, distractor_model=None, allow=False):
|
196 |
already_saved_names = user_task_database.fetch({'creator_name': creator_name,
|
197 |
'save_name': save_name,
|
198 |
'cefr_level': cefr_level}).items
|
|
|
235 |
'comments': comments}
|
236 |
user_task_database.put(new_save_data)
|
237 |
if save_type == 'download':
|
238 |
+
if allow:
|
239 |
+
return st.success('Задания успешно сохранены! Можете переходить на следующие вкладки')
|
240 |
elif save_type == 'online_test':
|
241 |
return st.success('Ответы успешно сохранены!')
|
242 |
|