modify quiz template and functions
-
Hello Support/Engineering Team,
I’m planning a Tutor LMS customization to deliver a full Computer‑Based Test (CBT) experience similar to official SSC/GATE/JEE exams. Before development, I’d appreciate guidance on the best, support‑friendly way to implement and maintain the following features via template overrides, hooks/filters, and safe server/client code.
What I want to build
- Official CBT interface
- Layout: Left question palette, center question area, right instruction panel.
- Header: Institution logo/name, quiz title, candidate info (name, user ID/roll), date/time.
- Timer: HH:MM:SS countdown with progress bar, warnings at T‑15, T‑5, T‑1 minutes, and auto‑submit on time up.
- Bottom navigation: Previous, Save & Next, Mark for Review & Next, Clear Response, Submit.
- Palette color coding:
- Green = Answered
- Red = Not answered
- Purple = Marked for review
- Blue = Current question
- Grey = Not visited
- Counters: Answered, Not answered, Marked, Not visited; optional section tabs.
- Numerical Range Questions (primary requirement)
- Types supported:
- Integer ranges (e.g., 5–10)
- Decimal ranges with precision (e.g., 2.5–3.7, 2 decimal places)
- Multiple ranges (e.g., valid if 5–10 OR 15–20)
- Percentage ranges (e.g., 25%–30%; normalize input with/without %)
- Tolerance (e.g., ±2% expands effective range)
- Scientific notation (e.g., 1.2e‑3, 2.45E+6)
- Admin UI per question:
- Data type (integer/decimal/percentage)
- Min/Max, decimal places, boundary inclusion (≤/≥ vs </>)
- Multiple ranges array (min, max, optional description)
- Tolerance %, allow scientific notation, unit suffix, show hints toggle
- Student experience:
- Real‑time validation and friendly messages
- Auto‑correction suggestions (nearest valid boundary) when enabled
- Visual states: valid (green), invalid (red), warning (amber)
- Restore saved input on revisit
- Server‑side grading mirrors client rules to avoid discrepancies.
- Attempt lifecycle, saving, and submission
- Auto‑save: Every 30 seconds and on key actions (navigation, mark, clear).
- Restore: Current question, answers, and marked flags after reload.
- Submission: Standard Tutor LMS flow; submit confirmation modal with summary.
- Security and integrity
- Disable right‑click/context menu, common dev‑tools shortcuts, and back‑button during attempts.
- Lightweight activity logging: tab switches, window blur/focus, repeated shortcut attempts.
- No caching headers for quiz pages; keep accessibility intact.
- Results page
- Official result view with pass/fail badge, marks/percentage/grade, correct/incorrect/skipped, total time and average per question, print‑friendly layout, optional download certificate integration.
- Compatibility and maintainability
- Implement as theme overrides and hook‑based customizations (no core edits).
- Keep compatibility with Tutor LMS reports, certificates, and updates.
- Clean deactivation path and minimal footprint.
Questions for your guidance
A) Best‑practice entry points
- Which hooks/filters do you recommend for:
- Replacing the quiz container with a three‑panel CBT layout?
- Injecting a custom question renderer for Numerical Range Questions?
- Validating and grading range answers on the server side?
B) Template override scope
- Are the following safe and supported to override in a child theme?
- tutor/single/quiz/single-quiz.php
- tutor/single/quiz/question.php
- tutor/single/quiz/quiz-result.php
- Any additional templates you advise overriding (e.g., partials for headers/pagination)?
C) Question type extensibility
- Is there an official way to register an additional question type (e.g., “numerical_range”) that appears in the Tutor LMS question builder UI?
- Recommended data structure for storing per‑question configuration (min/max, ranges[], tolerance, etc.) so it plays well with exports/backups?
D) Server‑side grading
- Which filters/actions are intended for determining correctness of a custom question type during attempt evaluation?
- Any constraints in the answer storage format that I should follow (string vs JSON vs array) for durability and analytics?
E) Saving/auto‑save
- Recommended approach to store “marked for review,” palette state, and current question index so they are recoverable on reload?
- Any rate‑limit or nonce expectations for periodic background saves?
F) Timer and auto‑submit
- Preferred method to trigger auto‑submit at time‑up that remains robust if connection temporarily drops?
- Hooks to safely finalize the attempt and redirect to result.
G) Security
- Are there documented guidelines or constraints for adding anti‑cheating measures (blocking certain keys, preventing back navigation) without interfering with LMS functions or accessibility?
H) Performance
- Any known limits or recommendations for AJAX payload sizes (e.g., large quizzes) and efficient ways to fetch a single question’s HTML/content?
I) Future‑proofing
- Changes planned in upcoming Tutor LMS releases that could affect question type registration, attempt storage, or template paths?
- Any internal utilities you suggest using instead of custom code to avoid breakage after updates?
If helpful, I can share wireframes and the UX map (palette with color legend, header with timer and candidate info, center content area, and right instructions) to align with your UI/UX expectations.
Please let me know:
- Which official APIs/hooks I should rely on for each area above
- Any reference docs or sample snippets you recommend
- Constraints to keep this solution update‑safe and supportable
Thanks in advance for your guidance. I’m happy to adapt the plan to match Tutor LMS best practices and keep everything maintainable across updates.
The page I need help with: [log in to see the link]
The topic ‘modify quiz template and functions’ is closed to new replies.