def _build_service_url(self, language, request, students, ordinal_number, url_name, submission_url): """ Generates complete URL with added parameters to the exercise service. """ uid_str = '-'.join(sorted(str(profile.user.id) for profile in students)) if students else '' auri = ( settings.OVERRIDE_SUBMISSION_HOST + submission_url if settings.OVERRIDE_SUBMISSION_HOST else request.build_absolute_uri(submission_url) ) return update_url_params(pick_localized(self.service_url, language), { "max_points": self.max_points, "max_submissions": self.max_submissions, "submission_url": auri, "post_url": request.build_absolute_uri(str(self.get_url(url_name))), "uid": uid_str, "ordinal_number": ordinal_number, "lang": language, })
def parse_localization(entry): return pick_localized(entry, get_language())
def get_templates(self): entries = pick_localized(self.templates, get_language()) return [(url,url.split('/')[-1]) for url in entries.split()]
def get_load_url(self, language, request, students, url_name="exercise"): return update_url_params(pick_localized(self.service_url, language), { 'lang': language, })
def get_models(self): entries = pick_localized(self.model_answers, get_language()) return [(url,url.split('/')[-1]) for url in entries.split()]
def get_templates(self): entries = pick_localized(self.templates, get_language()) return [(url, url.split('/')[-1]) for url in entries.split()]
def get_models(self): entries = pick_localized(self.model_answers, get_language()) return [(url, url.split('/')[-1]) for url in entries.split()]
def get_service_url(self, language): return pick_localized(self.service_url, language)