Learning foreign word exercise views¶
Word translate exercise view¶
Views for word study task module.
- class ForeignExerciseParamsView(**kwargs)¶
Bases:
ExerciseParamsView
Foreign word exercise conditions choice view.
- template_name = 'foreign/exercise/foreign_translate_choice.html'¶
The exercise params view template path (str).
- exercise_url = '/foreign/foreign-translate-demo/'¶
URL of the exercise to redirect to after selecting parameters (str). For example:
exercise_url = reverse_lazy('glossary:exercise')
- form¶
alias of
ForeignTranslateChoiceForm
- save_params(*args: object, **kwargs: object) None ¶
Save exercise params.
- class WordExerciseView(**kwargs)¶
Bases:
CheckLoginPermissionMixin
,View
Foreign word translate exercise view.
- template_name = 'foreign/exercise/foreign_translate_demo.html'¶
The view template path (str).
- msg_key_error = 'Не все условия упражнения заданы'¶
Error message in condition (‘str’).
- msg_no_words = 'По заданным условиям задание не сформировано'¶
Message no words found (str).
- get(request: HttpRequest) HttpResponse ¶
Display an exercise page to translate a word.
- post(request: HttpRequest) JsonResponse ¶
Render the task.
- update_word_progress_view(request: HttpRequest, **kwargs: object) JsonResponse | HttpResponse ¶
Update user word knowledge assessment view.
- Parameters:
request (HttpRequest) – Request to update user word knowledge assessment.
kwargs (object) –
ID of the word whose progress will be updated.
kwargs
fields:'word_id'
: word ID (int).
- Returns:
Response without data, with status 201.
- Return type:
JsonResponse
- update_words_favorites_status_view_ajax(request: HttpRequest, **kwargs: Dict[str, object]) JsonResponse ¶
Update the status of a word, is it favorite.
This view receives a request from Ajax when the user wants to update the status of a word.
Parameters¶
- requestHttpRequest
Http request.
- kwargsDict[str, object]
The keyword argument that contains the
word_id
of the word whose status should be updated.
Return¶
- responseJsonResponse
Response with current favorite word status.
Word exercise params views¶
Learning foreign words exercise parameters.
- class ForeignTaskSettingsView(**kwargs)¶
Bases:
DetailView
Display user’s learning foreign words exercise settings view.
- model¶
alias of
TranslateParams
- get_object(**kwargs: object) Model ¶
Return the object the view is displaying.
- class CreateForeignTaskSettingsView(**kwargs)¶
Bases:
CreateView
Create Foreign task settings view.
- model¶
alias of
TranslateParams
- class UpdateForeignTaskSettingsView(**kwargs)¶
Bases:
UpdateView
Update Foreign task settings view.
- model¶
alias of
TranslateParams