Initial commit: PastPaper Master full stack
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
52
supabase/seeds/comp2211_2022_fall_page_number_backfill.sql
Normal file
52
supabase/seeds/comp2211_2022_fall_page_number_backfill.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
UPDATE paper_questions
|
||||
SET page_number = CASE question_number
|
||||
WHEN '1a' THEN 2
|
||||
WHEN '1b' THEN 2
|
||||
WHEN '1c' THEN 2
|
||||
WHEN '1d' THEN 2
|
||||
WHEN '1e' THEN 2
|
||||
WHEN '1f' THEN 2
|
||||
WHEN '1g' THEN 2
|
||||
WHEN '1h' THEN 2
|
||||
WHEN '1i' THEN 2
|
||||
WHEN '1j' THEN 2
|
||||
WHEN '2a_i' THEN 3
|
||||
WHEN '2a_ii' THEN 3
|
||||
WHEN '2a_iii' THEN 3
|
||||
WHEN '2a_iv' THEN 3
|
||||
WHEN '2a_v' THEN 4
|
||||
WHEN '2a_vi' THEN 4
|
||||
WHEN '2a_vii' THEN 4
|
||||
WHEN '2b_i' THEN 5
|
||||
WHEN '2b_ii' THEN 5
|
||||
WHEN '2b_iii' THEN 5
|
||||
WHEN '2c' THEN 6
|
||||
WHEN '3a_i' THEN 8
|
||||
WHEN '3a_ii' THEN 8
|
||||
WHEN '3b_i' THEN 9
|
||||
WHEN '3b_ii' THEN 9
|
||||
WHEN '3b_iii' THEN 10
|
||||
WHEN '3c' THEN 10
|
||||
WHEN '3d' THEN 11
|
||||
WHEN '4a' THEN 12
|
||||
WHEN '4b' THEN 13
|
||||
WHEN '4c' THEN 13
|
||||
WHEN '4d' THEN 13
|
||||
WHEN '5a' THEN 14
|
||||
WHEN '5b' THEN 14
|
||||
WHEN '5c' THEN 14
|
||||
WHEN '5d' THEN 15
|
||||
WHEN '5e' THEN 15
|
||||
WHEN '5f' THEN 15
|
||||
WHEN '6a' THEN 16
|
||||
WHEN '6b_i' THEN 17
|
||||
WHEN '6b_ii' THEN 17
|
||||
WHEN '7a' THEN 18
|
||||
WHEN '7b' THEN 18
|
||||
ELSE page_number
|
||||
END
|
||||
WHERE paper_id = (
|
||||
SELECT id
|
||||
FROM papers
|
||||
WHERE source_exam_key = 'COMP2211-2022-fall-midterm'
|
||||
);
|
||||
148
supabase/seeds/comp2211_course_library_papers.sql
Normal file
148
supabase/seeds/comp2211_course_library_papers.sql
Normal file
@@ -0,0 +1,148 @@
|
||||
-- ============================================
|
||||
-- PastPaper Master — COMP2211 course library papers
|
||||
-- Seed Date: 2026-03-24
|
||||
-- ============================================
|
||||
--
|
||||
-- Before running:
|
||||
-- 1. Upload the referenced PDFs into the `papers` bucket using the exact storage paths below.
|
||||
-- 2. Replace __SUPABASE_STORAGE_PUBLIC_BASE_URL__ with your project-specific public base URL.
|
||||
--
|
||||
-- Example base URL:
|
||||
-- https://<project-ref>.supabase.co/storage/v1/object/public/papers
|
||||
--
|
||||
-- This seed only inserts canonical, importable COMP2211 course-library papers.
|
||||
|
||||
INSERT INTO papers (
|
||||
user_id,
|
||||
course_code,
|
||||
year,
|
||||
term,
|
||||
exam_type,
|
||||
part_label,
|
||||
paper_file_url,
|
||||
answer_file_url,
|
||||
status,
|
||||
source_kind,
|
||||
source_exam_key,
|
||||
source_question_filename,
|
||||
source_answer_filename
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2022,
|
||||
'fall',
|
||||
'midterm',
|
||||
NULL,
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-fall-midterm/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-fall-midterm/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2022-fall-midterm',
|
||||
'(COMP2211)[2022](f)midterm~=yjz8dxdd^_27002.pdf',
|
||||
'(COMP2211)[2022](f)midterm~=yjz8dxdd^_18747.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2022,
|
||||
'spring',
|
||||
'midterm',
|
||||
NULL,
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-midterm/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-midterm/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2022-spring-midterm',
|
||||
'(COMP2211)[2022](s)midterm~=b8bidkgs^_14629.pdf',
|
||||
'(COMP2211)[2022](s)midterm~=6ma030^_89587.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2022,
|
||||
'spring',
|
||||
'final',
|
||||
'A',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-final-part-a/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-final-part-a/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2022-spring-final-part-a',
|
||||
'(COMP2211)[2022](s)final~=b8bidkgs^_33018.pdf',
|
||||
'(COMP2211)[2022](s)final~=ajou6^_82011.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2022,
|
||||
'spring',
|
||||
'final',
|
||||
'B',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-final-part-b/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2022-spring-final-part-b/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2022-spring-final-part-b',
|
||||
'(COMP2211)[2022](s)final~=b8bidkgs^_40627.pdf',
|
||||
'(COMP2211)[2022](s)final~=ajou6^_51199.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2023,
|
||||
'spring',
|
||||
'midterm',
|
||||
NULL,
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2023-spring-midterm/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2023-spring-midterm/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2023-spring-midterm',
|
||||
'(COMP2211)[2023](s)midterm~=bxbidkmj^_26587.pdf',
|
||||
'(COMP2211)[2023](s)midterm~clchanbg^_17297.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2024,
|
||||
'spring',
|
||||
'midterm',
|
||||
NULL,
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2024-spring-midterm/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2024-spring-midterm/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2024-spring-midterm',
|
||||
'(COMP2211)[2024](s)midterm~=rcidkjgf^_82003.pdf',
|
||||
'(COMP2211)[2024](s)midterm~=ubrzkjmz^_90406.pdf'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
'COMP2211',
|
||||
2024,
|
||||
'spring',
|
||||
'final',
|
||||
NULL,
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2024-spring-final/paper.pdf',
|
||||
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__/course-library/COMP2211/COMP2211-2024-spring-final/answer.pdf',
|
||||
'uploaded',
|
||||
'course_library',
|
||||
'COMP2211-2024-spring-final',
|
||||
'(COMP2211)[2024](s)final~=igk5mmg^_90365.pdf',
|
||||
'(COMP2211)[2024](s)final~=igk5mmg^_58857.pdf'
|
||||
)
|
||||
ON CONFLICT (source_exam_key)
|
||||
WHERE source_kind = 'course_library' AND source_exam_key IS NOT NULL
|
||||
DO UPDATE SET
|
||||
course_code = EXCLUDED.course_code,
|
||||
year = EXCLUDED.year,
|
||||
term = EXCLUDED.term,
|
||||
exam_type = EXCLUDED.exam_type,
|
||||
part_label = EXCLUDED.part_label,
|
||||
paper_file_url = EXCLUDED.paper_file_url,
|
||||
answer_file_url = EXCLUDED.answer_file_url,
|
||||
status = EXCLUDED.status,
|
||||
source_question_filename = EXCLUDED.source_question_filename,
|
||||
source_answer_filename = EXCLUDED.source_answer_filename;
|
||||
7173
supabase/seeds/comp2211_problem_level_questions.sql
Normal file
7173
supabase/seeds/comp2211_problem_level_questions.sql
Normal file
File diff suppressed because it is too large
Load Diff
109
supabase/seeds/comp2211_problem_taxonomy_backfill.sql
Normal file
109
supabase/seeds/comp2211_problem_taxonomy_backfill.sql
Normal file
@@ -0,0 +1,109 @@
|
||||
-- ============================================
|
||||
-- PastPaper Master — COMP2211 problem-level taxonomy backfill
|
||||
-- Seed Date: 2026-03-24
|
||||
-- ============================================
|
||||
--
|
||||
-- Purpose:
|
||||
-- 1. Backfill coarse taxonomy for COMP2211 question rows after the paper has been
|
||||
-- processed into `paper_questions`.
|
||||
-- 2. Use the audited cover-page problem mapping as the initial analytics baseline.
|
||||
-- 3. Only fill empty taxonomy fields, so later fine-grained per-question curation
|
||||
-- can safely overwrite these defaults.
|
||||
|
||||
WITH mapping AS (
|
||||
SELECT *
|
||||
FROM (
|
||||
VALUES
|
||||
('COMP2211-2022-fall-midterm', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2022-fall-midterm', '2', 'Python Fundamentals', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals']::TEXT[], ARRAY['code_tracing', 'implementation', 'debugging']::TEXT[], 'coding'),
|
||||
('COMP2211-2022-fall-midterm', '3', 'Conditional Probability and Bayes Classifier', 'Probabilistic Models', 'Probabilistic Models', ARRAY['Probabilistic Models']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'classification_decision']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-fall-midterm', '4', 'K-Nearest Neighbors', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'distance_calculation', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-fall-midterm', '5', 'K-Means Clustering', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'cluster_update', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-fall-midterm', '6', 'Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['manual_computation', 'weight_update', 'formula_application']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-fall-midterm', '7', 'Multilayer Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['forward_pass', 'backpropagation', 'derivation']::TEXT[], 'long_question'),
|
||||
|
||||
('COMP2211-2022-spring-midterm', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2022-spring-midterm', '2', 'Python Fundamentals', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals']::TEXT[], ARRAY['code_tracing', 'implementation', 'debugging']::TEXT[], 'coding'),
|
||||
('COMP2211-2022-spring-midterm', '3', 'Conditional Probability and Bayes Classifier', 'Probabilistic Models', 'Probabilistic Models', ARRAY['Probabilistic Models']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'classification_decision']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-midterm', '4', 'K-Nearest Neighbors', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'distance_calculation', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-midterm', '5', 'K-Means Clustering', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'cluster_update', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-midterm', '6', 'Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['manual_computation', 'weight_update', 'formula_application']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-midterm', '7', 'Perceptron and Multilayer Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['forward_pass', 'backpropagation', 'weight_update']::TEXT[], 'long_question'),
|
||||
|
||||
('COMP2211-2022-spring-final-part-a', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2022-spring-final-part-a', '2', 'Na¨ıve Bayes and K-Nearest Neighbors', NULL, 'Probabilistic Models', ARRAY['Probabilistic Models', 'KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'distance_calculation']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-final-part-a', '3', 'Multilayer Perceptron (MLP)', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['forward_pass', 'backpropagation', 'derivation']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-final-part-a', '4', 'Digital Image Processing', 'Vision and CNN', 'Vision and CNN', ARRAY['Vision and CNN']::TEXT[], ARRAY['manual_computation', 'filter_computation', 'architecture_reasoning']::TEXT[], 'long_question'),
|
||||
|
||||
('COMP2211-2022-spring-final-part-b', '1', 'Convolutional Neural Network (CNN)', 'Vision and CNN', 'Vision and CNN', ARRAY['Vision and CNN']::TEXT[], ARRAY['forward_pass', 'architecture_reasoning', 'manual_computation']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-final-part-b', '2', 'Python Programming: Convolutional Neural Network', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals', 'Vision and CNN']::TEXT[], ARRAY['implementation', 'code_tracing', 'debugging']::TEXT[], 'coding'),
|
||||
('COMP2211-2022-spring-final-part-b', '3', 'Minimax and Alpha-Beta Pruning', 'Search and Games', 'Search and Games', ARRAY['Search and Games']::TEXT[], ARRAY['tree_search', 'pruning', 'manual_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2022-spring-final-part-b', '4', 'Ethics of Artificial Intelligence', 'Ethics of AI', 'Ethics of AI', ARRAY['Ethics of AI']::TEXT[], ARRAY['concept_explanation', 'argumentation', 'comparison']::TEXT[], 'short_answer'),
|
||||
|
||||
('COMP2211-2023-spring-midterm', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2023-spring-midterm', '2', 'Python Fundamentals', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals']::TEXT[], ARRAY['code_tracing', 'implementation', 'debugging']::TEXT[], 'coding'),
|
||||
('COMP2211-2023-spring-midterm', '3', 'Na¨ıve Bayes Classifier', 'Probabilistic Models', 'Probabilistic Models', ARRAY['Probabilistic Models']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'classification_decision']::TEXT[], 'long_question'),
|
||||
('COMP2211-2023-spring-midterm', '4', 'K-Nearest Neighbors', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'distance_calculation', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2023-spring-midterm', '5', 'K-Means Clustering', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'cluster_update', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2023-spring-midterm', '6', 'Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['manual_computation', 'weight_update', 'formula_application']::TEXT[], 'long_question'),
|
||||
('COMP2211-2023-spring-midterm', '7', 'Multilayer Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['forward_pass', 'backpropagation', 'derivation']::TEXT[], 'long_question'),
|
||||
|
||||
('COMP2211-2024-spring-midterm', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2024-spring-midterm', '2', 'Advanced Python for Artificial Intelligence', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals']::TEXT[], ARRAY['code_tracing', 'implementation', 'data_manipulation']::TEXT[], 'coding'),
|
||||
('COMP2211-2024-spring-midterm', '3', 'Model Evaluation & Advanced Python Programming', 'Evaluation and Validation', 'Evaluation and Validation', ARRAY['Evaluation and Validation', 'Python Fundamentals']::TEXT[], ARRAY['metric_computation', 'experimental_design', 'implementation']::TEXT[], 'coding'),
|
||||
('COMP2211-2024-spring-midterm', '4', 'Na¨ıve Bayes Classifier', 'Probabilistic Models', 'Probabilistic Models', ARRAY['Probabilistic Models']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'classification_decision']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-midterm', '5', 'K-Nearest Neighbors', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'distance_calculation', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-midterm', '6', 'Leader Clustering', 'KNN and Clustering', 'KNN and Clustering', ARRAY['KNN and Clustering']::TEXT[], ARRAY['manual_computation', 'cluster_update', 'algorithm_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-midterm', '7', 'D-fold Cross Validation', 'Evaluation and Validation', 'Evaluation and Validation', ARRAY['Evaluation and Validation']::TEXT[], ARRAY['metric_computation', 'experimental_design', 'reasoning']::TEXT[], 'long_question'),
|
||||
|
||||
('COMP2211-2024-spring-final', '1', 'True/False Questions', 'True/False', 'True/False', ARRAY['True/False']::TEXT[], ARRAY['concept_check', 'rapid_reasoning']::TEXT[], 'true_false'),
|
||||
('COMP2211-2024-spring-final', '2', 'Advanced Python: Image Processing with NumPy', 'Python Fundamentals', 'Python Fundamentals', ARRAY['Python Fundamentals', 'Vision and CNN']::TEXT[], ARRAY['implementation', 'data_manipulation', 'filter_computation']::TEXT[], 'coding'),
|
||||
('COMP2211-2024-spring-final', '3', 'Na¨ıve Bayes, K-Nearest Neighbors and Perceptron', NULL, 'Probabilistic Models', ARRAY['Probabilistic Models', 'KNN and Clustering', 'Perceptron and MLP']::TEXT[], ARRAY['manual_computation', 'probability_reasoning', 'distance_calculation', 'weight_update']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '4', 'Multi-layer Perceptron', 'Perceptron and MLP', 'Perceptron and MLP', ARRAY['Perceptron and MLP']::TEXT[], ARRAY['forward_pass', 'backpropagation', 'derivation']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '5', 'Digital Image Processing', 'Vision and CNN', 'Vision and CNN', ARRAY['Vision and CNN']::TEXT[], ARRAY['manual_computation', 'filter_computation', 'architecture_reasoning']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '6', 'Dilated Convolution and Dropout', 'Vision and CNN', 'Vision and CNN', ARRAY['Vision and CNN']::TEXT[], ARRAY['architecture_reasoning', 'forward_pass', 'comparison']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '7', 'Convolutional Neural Network', 'Vision and CNN', 'Vision and CNN', ARRAY['Vision and CNN']::TEXT[], ARRAY['architecture_reasoning', 'forward_pass', 'implementation']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '8', 'Minimax and Alpha-Beta Pruning', 'Search and Games', 'Search and Games', ARRAY['Search and Games']::TEXT[], ARRAY['tree_search', 'pruning', 'manual_tracing']::TEXT[], 'long_question'),
|
||||
('COMP2211-2024-spring-final', '9', 'Ethics of Artificial Intelligence', 'Ethics of AI', 'Ethics of AI', ARRAY['Ethics of AI']::TEXT[], ARRAY['concept_explanation', 'argumentation', 'comparison']::TEXT[], 'short_answer')
|
||||
) AS t (
|
||||
source_exam_key,
|
||||
problem_number,
|
||||
raw_topic,
|
||||
analytics_topic,
|
||||
topic_primary,
|
||||
topic_tags,
|
||||
skill_tags,
|
||||
default_question_format
|
||||
)
|
||||
)
|
||||
UPDATE paper_questions AS q
|
||||
SET analytics_topic = COALESCE(q.analytics_topic, mapping.analytics_topic),
|
||||
topic_primary = COALESCE(q.topic_primary, mapping.topic_primary),
|
||||
topic_tags = CASE
|
||||
WHEN q.topic_tags IS NULL OR cardinality(q.topic_tags) = 0 THEN mapping.topic_tags
|
||||
ELSE q.topic_tags
|
||||
END,
|
||||
skill_tags = CASE
|
||||
WHEN q.skill_tags IS NULL OR cardinality(q.skill_tags) = 0 THEN mapping.skill_tags
|
||||
ELSE q.skill_tags
|
||||
END,
|
||||
topics = CASE
|
||||
WHEN q.topics IS NULL OR cardinality(q.topics) = 0 THEN mapping.topic_tags
|
||||
ELSE q.topics
|
||||
END,
|
||||
question_format = CASE
|
||||
WHEN (q.question_format IS NULL OR q.question_format = '')
|
||||
AND mapping.default_question_format IS NOT NULL
|
||||
THEN mapping.default_question_format
|
||||
ELSE q.question_format
|
||||
END
|
||||
FROM papers AS p
|
||||
JOIN mapping
|
||||
ON mapping.source_exam_key = p.source_exam_key
|
||||
WHERE q.paper_id = p.id
|
||||
AND p.source_kind = 'course_library'
|
||||
AND p.course_code = 'COMP2211'
|
||||
AND (
|
||||
q.question_number = mapping.problem_number
|
||||
OR q.question_number ~ ('^' || mapping.problem_number || '([^0-9].*)?$')
|
||||
);
|
||||
Reference in New Issue
Block a user