<?php 

function cp_write_quiz_cb() {
	global $app;
	$user_meta = $app->user_meta;
	if(!isset($_GET['id'])) return_method();
	$post = new post;
	$quiz_meta = $post->get_post_meta($_GET['id']);
	?>
	<div class="cp-combo-box-body">
		<div class="row">
			<div class="col-md-12">
				<link rel="stylesheet" type="text/css" href="contents/plugins/classroom_plus/template/assets/css/quiz.css">
				<?php 
					switch ($user_meta['debt_status']) {
						case 'not in debt':
						case 'part payment':
							do_action("cp_play_quiz", $quiz_meta);
							break;
						
						case 'in debt':
						default:
							?>
							<div class="row mb-4">
								<div class="flashcardcover">
								    <div class="flashcard-container">
								      <article class="flashcard">
								        You are still owing or your payment has not been recorded. Please pay up before you can proceed
								      </article>
								    </div>
								</div>
							</div>
							
							<?php
							render_page_content("my-invoices");
							break;
					}
				 ?>
			</div>
		</div>
	</div>
	<?php
}