Newer
Older
if grade_data["feedback_text"]:
feedback_text += (
string_concat(
"<p>",
_("The following feedback was provided"),
":<p>")
+ markup_to_html(
page_context, grade_data["feedback_text"]))
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
return AnswerFeedback(
correctness=correctness,
feedback=feedback_text)
else:
return None
class PageBaseWithCorrectAnswer(PageBase):
def allowed_attrs(self):
return super(PageBaseWithCorrectAnswer, self).allowed_attrs() + (
("correct_answer", "markup"),
)
def correct_answer(self, page_context, page_data, answer_data, grade_data):
if hasattr(self.page_desc, "correct_answer"):
return markup_to_html(page_context, self.page_desc.correct_answer)
else:
return None
# }}}
def get_editor_interaction_mode(page_context):
if (page_context.flow_session is not None
and page_context.flow_session.participation is not None):
return page_context.flow_session.participation.user.editor_mode
else:
return "default"