WP Manifestindependent plugin directory
manifest / content / tfa-quizzes

TFA Interactive Quizzes

WordPress plugin for interactive quizzes with score tiers and social sharing

by Texas Football Analytics · github.com/brandonfricke/tfa-quizzes · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/brandonfricke/tfa-quizzes/archive/refs/heads/main.zip

A WordPress plugin providing interactive quiz functionality with score tiers, explanations, and social sharing.

Features

  • Custom Post Type for quizzes
  • [tfa_quiz] shortcode for embedding quizzes
  • Multiple choice questions with 4 options each
  • Per-question explanations
  • Score tiers with Texas Longhorns theme
  • Social sharing via Web Share API or clipboard
  • Retry functionality
  • Progress tracking
  • Accessible ARIA markup
  • Dark mode support
  • Mobile-responsive design

Requirements

  • WordPress 6.0+
  • PHP 7.4+

Installation

  1. Download the plugin
  2. Upload to /wp-content/plugins/tfa-quizzes/
  3. Activate the plugin in WordPress Admin > Plugins
  4. Configure settings in Settings > TFA Quizzes

Usage

Creating a Quiz

  1. Go to Quizzes > Add New in WordPress Admin
  2. Enter your quiz title
  3. Add a description (optional)
  4. Add questions:
    • Enter the question text
    • Add 4 answer options
    • Select the correct answer (radio button)
    • Add an explanation (shown after answering)
  5. Publish the quiz

Embedding a Quiz

Use the shortcode in any post or page:

[tfa_quiz id="123"]

Replace 123 with your quiz ID (shown in the Quiz settings sidebar).

Score Tiers

Score Tier Emoji
90-100% Longhorn Legend 🏆
70-89% True Fan 🤘
50-69% Casual Observer 👀
0-49% Keep Learning 📚

Styling

The plugin includes CSS with CSS custom properties that integrate with themes using the following tokens:

  • --color-surface - Background color
  • --color-border - Border color
  • --color-text - Text color
  • --color-primary - Primary accent color (default: #bf5700)
  • --radius-md - Border radius
  • --space-* - Spacing scale

Color States

  • Correct answers: Green (#059669)
  • Incorrect answers: Red (#dc2626)

Dark mode is supported via the .tfa-dark-mode body class.

JavaScript API

The quiz state is managed client-side. Key functions (exported as ES modules):

  • calculateScore(correct, total) - Calculate score percentage
  • getScoreTier(percentage, tiers) - Get tier for score
  • createQuizState(totalQuestions) - Initialize quiz state
  • answerQuestion(state, index, isCorrect) - Update state after answer
  • nextQuestion(state) - Move to next question
  • resetQuiz(totalQuestions) - Reset to initial state
  • shareResult(text, url) - Share via Web Share API or clipboard

Changelog

1.0.0

  • Initial release
  • Extracted from Texas Football Analytics theme v1.10.0

License

GPL-2.0+