\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}{12}
\sujet{المتابعة الزمنية لتحول كيميائي}

يمثل المنحنى تطور تقدم تفاعل كيميائي $x(t)$ (التحول تام).

\cadre{\begin{tikzpicture}\begin{axis}[axis lines=left,grid=both,grid style={gray!25},width=10cm,height=7cm,ticklabel style={font=\small},xmin=0,xmax=31,ymin=0,ymax=5,xtick={0,5,...,30},ytick={0,1,...,5},xlabel={$t\,(\mathrm{min})$},ylabel={$x\,(\mathrm{mmol})$}]
\addplot[blue,very thick,domain=0:30,samples=80]{4*(1-exp(-x*ln(2)/5))};
\draw[gray,dashed,thick] (axis cs:0,4)--(axis cs:31,4);\end{axis}\end{tikzpicture}}

\textbf{السؤال:} عيّن التقدم الأعظمي $x_{max}$ وزمن نصف التفاعل $t_{1/2}$.

\rep
\end{document}
