<commit_before>-- BLOCK select_errors
SELECT
    e.*,
    format_date_full(e.date, ci.display_timezone) AS formatted_date
FROM
    errors AS e
    JOIN course_instances AS ci ON (ci.id = e.course_instance_id)
WHERE
    e.variant_id = $variant_id
    AND e.course_caused
ORDER BY
    e.date;

-- BLOCK select_submissions
SELECT
    s.*,
    gj.id AS grading_job_id,
    grading_job_status(gj.id) AS grading_job_status,
    format_date_full_compact(s.date, coalesce(ci.display_timezone, c.display_timezone)) AS formatted_date,
    CASE
        WHEN s.grading_requested_at IS NOT NULL THEN format_interval($req_date - s.grading_requested_at)
        ELSE NULL
    END AS elapsed_grading_time
FROM
    submissions AS s
    JOIN variants AS v ON (v.id = s.variant_id)
    LEFT JOIN instance_questions AS iq ON (iq.id = v.instance_question_id)<commit_msg>fix errors display on pages/instructorQuestion<commit_after>-- BLOCK select_errors
SELECT
    e.*,
    format_date_full(e.date, coalesce(ci.display_timezone, c.display_timezone)) AS formatted_date
FROM
    errors AS e
    LEFT JOIN course_instances AS ci ON (ci.id = e.course_instance_id)
    JOIN pl_courses AS c ON (c.id = e.course_id)
WHERE
    e.variant_id = $variant_id
    AND e.course_caused
ORDER BY
    e.date;

-- BLOCK select_submissions
SELECT
    s.*,
    gj.id AS grading_job_id,
    grading_job_status(gj.id) AS grading_job_status,
    format_date_full_compact(s.date, coalesce(ci.display_timezone, c.display_timezone)) AS formatted_date,
    CASE
        WHEN s.grading_requested_at IS NOT NULL THEN format_interval($req_date - s.grading_requested_at)
        ELSE NULL
    END AS elapsed_grading_time
FROM
    submissions AS s
    JOIN variants AS v ON (v.id = s.variant_id)
    LEFT JOIN instance_questions AS iq ON (iq.id = v.instance_question_id)
{'fraction_non_alphanumeric': 0.07272727272727272, 'fraction_numerical': 0.0, 'mean_word_length': 3.5743073047858944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7611966', 'n_tokens_mistral': 670, 'n_tokens_neox': 625, 'n_words': 164}