Check your understanding of the previous reading: the Commenter program.
The page_commenter function displays the original text and any comments that have been added. Which of the following is TRUE about how the page_commenter function works?
Select one answer, then check.
content starts as [Header("Code Commenter")], so its first element is a Header, not a Div.append calls are in an if/else, so only one of them ever runs; combined with the separate if line.comment append, at most two elements are added per iteration, never three.else branch for an empty line appends Div(classes="comment-line", style_height="1.5em"), a blank spacer with no button at all.Div has zero content components, a comment's Div(small_font(line.comment), ...) has one, and a line with text has two: Div(line.original, Button(...), ...).Which of these is NOT an accurate description of how functions are decomposed in this program?
Select one answer, then check.
start_commenting returns error_page(...) when there's no file and no text.page_commenter(state).lines = parse_lines(text) is right there in the function body.save_comment ends with return page_commenter(state).save_comment only does state.comments[index].comment = comment_box before calling page_commenter; it never calls parse_lines, which only runs once, from start_commenting.The start_commenting function updates the State to include the original_text field, which contains the original text to be commented on. Why is the original_text field kept in the State?
Select one answer, then check.
page_commenter never reads state.original_text; it builds its display from state.comments, where each Line already carries its own original text.Line.comment, not from state.original_text.add_comment function in this program; comments are saved by save_comment, which doesn't use original_text either.add_comment function here.index pre-fills the text area with TextArea("text_box", state.original_text), so when the "Reset" button on the commenting page sends the user back to index, their earlier text reappears instead of an empty box.page_commenter, not back to index, so index is never shown "immediately after" an upload.