@extends('admin.layouts.app') @section('title', 'Question Explanations') @section('content') @if(session('success'))
{{ session('success') }}
@endif
Add Explanation
@csrf
Use $...$ for inline equations or $$...$$ for block equations.
For images, you can insert <img src="data:image/jpeg;base64,..."> HTML tags directly!
Saved Explanations Display preview
@forelse($explanations as $explanation)
@if($explanation->title)
{{ $explanation->title }}
@endif
@php $cleanContent = $explanation->content; // Process block math $$...$$ $cleanContent = preg_replace_callback('/\$\$([\s\S]+?)\$\$/', function($matches) { // Strip raw newlines and
tags within the math $math = preg_replace('/|\n|\r/i', ' ', $matches[1]); return '$$' . $math . '$$'; }, $cleanContent); // Process inline math $...$ and upgrade to display math $$ \displaystyle{...} $$ $cleanContent = preg_replace_callback('/\$([\s\S]+?)\$/', function($matches) { $math = preg_replace('/|\n|\r/i', ' ', $matches[1]); return '$$\displaystyle{' . $math . '}$$'; }, $cleanContent); @endphp {!! $cleanContent !!}
@empty

No explanations saved yet. Try adding one on the left!

@endforelse
@endsection