\documentclass[12pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{tikz,tkz-tab}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usetikzlibrary{arrows.meta,calc,positioning}
\usepackage{fontspec}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{array}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{french}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.15]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.15]{Amiri}
\newcommand{\cadre}[1]{\begin{center}\begin{LTR}#1\end{LTR}\end{center}}
\newcommand{\cadrertl}[1]{\begin{center}#1\end{center}}
\newcommand{\ipa}[1]{#1}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\newcounter{q}
\newcommand{\sujet}[1]{%
  \newpage\stepcounter{q}%
  \begin{tcolorbox}[colback=blue!5,colframe=blue!60!black,arc=3mm,boxrule=1pt]
  \centering {\Large\bfseries مسابقة بين الثانويات -- العلوم الطبيعية}\\[2mm]
  {\large السؤال رقم \theq \quad -- \quad #1 \quad -- \quad المدة: دقيقتان}
  \end{tcolorbox}\vspace{5mm}\large}
\newcommand{\rep}{\vfill\begin{tcolorbox}[colback=white,colframe=black!50,height=3.2cm,title=الإجابة:]\end{tcolorbox}}
\newenvironment{sanad}{\begin{tcolorbox}[colback=orange!4,colframe=orange!60!black,title=السند,fonttitle=\bfseries]}{\end{tcolorbox}}
\begin{document}
\setcounter{q}{5}
\sujet{الاستجابة المناعية الأولية والثانوية}

حقن أرنب بمستضد في اليوم 0 ثم بالمستضد نفسه في اليوم 30. يمثل المنحنى تركيز الأجسام المضادة في المصل.

\cadre{\begin{tikzpicture}\begin{axis}[axis lines=left,grid=both,grid style={gray!25},width=10cm,height=7cm,ticklabel style={font=\small},legend style={font=\small},xmin=-2,xmax=50,ymin=0,ymax=110,xtick={0,10,...,50},ytick=\empty,xlabel={$t$ (jours)},ylabel={[Ac]}]
\addplot[blue,very thick,smooth,samples=120,domain=0:50]{ (x<30)*15*exp(-(x-12)^2/30) + (x>=30)*(15*exp(-(x-12)^2/30)+95*exp(-(x-37)^2/25)*(x>30)) };
\draw[-{Stealth},thick] (axis cs:0,40)--(axis cs:0,2);\draw[-{Stealth},thick] (axis cs:30,40)--(axis cs:30,2) node[pos=0,above,font=\small] {2};
\node[font=\small] at (axis cs:2,45) {1};\end{axis}\end{tikzpicture}}

\textbf{السؤال:} قارن بين الاستجابتين (المدة والشدة)، ثم فسّر الفرق.

\rep
\end{document}
