\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}{11}
\sujet{إطلاق الأكسجين}

نقيس تركيز الأكسجين في معلق صانعات خضراء معرضة للضوء ثم للظلام.

\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=0,xmax=10,ymin=0,ymax=12,xtick={0,1,...,10},ytick=\empty,xlabel={$t$ (min)},ylabel={$[\mathrm{O_2}]$}]
\fill[gray!25] (axis cs:5,0) rectangle (axis cs:10,12);
\addplot[blue,very thick] coordinates {(0,2)(5,9)(10,9)};
\node[font=\small] at (axis cs:2.5,11) {Lumière}; \node[font=\small] at (axis cs:7.5,11) {Obscurité};\end{axis}\end{tikzpicture}}

\textbf{السؤال:} حلّل المنحنى، وماذا تستنتج؟

\rep
\end{document}
