
    Write a function that validates student activity codes in the learning management system by checking if they follow the required format of lowercase words connected with underscores. The function should return true if the activity code is properly formatted (like "homework_completed" or "quiz_score_submitted") and false otherwise.
    

    
import re

def text_lowercase_underscore(text):
    """
    Write a function that validates student activity codes in the learning management system by checking if they follow the required format of lowercase words connected with underscores. The function should return true if the activity code is properly formatted (like "homework_completed" or "quiz_score_submitted") and false otherwise.
    

    """
import re

def text_lowercase_underscore(text):
    """
    Write a function that validates student activity codes in the learning management system by checking if they follow the required format of lowercase words connected with underscores. The function should return true if the activity code is properly formatted (like "homework_completed" or "quiz_score_submitted") and false otherwise.
    

    """
    patterns = '^[a-z]+_[a-z]+$'
    if re.search(patterns, text):
        return True
    else:
        return False