Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用PHP实现多选多答中的微分选择_Php_Css_Arrays_Checkbox_Comparison - Fatal编程技术网

用PHP实现多选多答中的微分选择

用PHP实现多选多答中的微分选择,php,css,arrays,checkbox,comparison,Php,Css,Arrays,Checkbox,Comparison,我有多个选择和多个答案。我想用正确答案和错误答案选择不同的选项。我已经用一个答案回答了这类问题,但在这种情况下,正确答案可能不止一个。 . 我已经尝试了下面的代码,但我将得到唯一的单值检查不是所有的。我不知道为什么 <?php $a1 = [trim($m_o1), trim($m_o2), trim($m_o3), trim($m_o4), trim($m_o5)]; shuffle($a1); $b1 = ['m_o1', 'm_o2', 'm_o3', 'm_o4' ,'

我有多个选择和多个答案。我想用正确答案和错误答案选择不同的选项。我已经用一个答案回答了这类问题,但在这种情况下,正确答案可能不止一个。 . 我已经尝试了下面的代码,但我将得到唯一的单值检查不是所有的。我不知道为什么

<?php 
$a1 = [trim($m_o1), trim($m_o2), trim($m_o3), trim($m_o4), trim($m_o5)];
shuffle($a1);
$b1      = ['m_o1', 'm_o2', 'm_o3', 'm_o4' ,'m_o5'];
$result1 = array_combine($b1, $a1);
extract($result1);
$sc_flag2=0;
$actual_flag2=0;
if($m_c1=='1')
{
    $correct_answer2 = array(
        $m_oo1
    );

}
else if($m_c1=='2')
{
    $correct_answer2 = array(
        $m_oo1,
        $m_oo2
    );

}
else if($m_c1=='3')
{
    $correct_answer2 = array(
        $m_oo1,
        $m_oo2,
        $m_oo3
    );

}
else if($m_c1=='4')
{
    $correct_answer2 = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4
    );

}
else if($m_c1=='5')
{
$correct_answer2 = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4,
        $m_oo5
    );

}
else
{
    $correct_answer2 = array();

}

$multiple_answer = array(
        $multiple_answer_1_1,
        $multiple_answer_1_2,
        $multiple_answer_1_3,
        $multiple_answer_1_4,
        $multiple_answer_1_5
    );
//print_r($multiple_answer);
//print_r($correct_answer2);

if (in_array($m_o1, $correct_answer2) && in_array($multiple_answer, $correct_answer2)) {
    $sc_flag2 = 1; // student's selected correct flag
}
if (in_array($m_o2, $correct_answer2) && in_array($multiple_answer, $correct_answer2)) {
    $sc_flag2 = 2; // student's selected correct flag
}
if (in_array($m_o3, $correct_answer2) && in_array($multiple_answer, $correct_answer2)) {
    $sc_flag2 = 3; // student's selected correct flag
}
if (in_array($m_o4, $correct_answer2) && in_array($multiple_answer, $correct_answer2)) {
    $sc_flag2 = 4; // student's selected correct flag
}
if (in_array($m_o5, $correct_answer2) && in_array($multiple_answer, $correct_answer2)) {
    $sc_flag2 = 5; // student's selected correct flag
}

if (in_array($m_o1, $correct_answer2)) {
    $correct_flag2 = 1; // student's selected correct flag
}
if (in_array($m_o2, $correct_answer2)) {
    $correct_flag2 = 2; // student's selected correct flag
}
if (in_array($m_o3, $correct_answer2)) {
    $correct_flag = 3; // student's selected correct flag
}
if (in_array($m_o4, $correct_answer2)) {
    $correct_flag2 = 4; // student's selected correct flag
}
if (in_array($m_o5, $correct_answer2)) {
    $correct_flag2 = 5; // student's selected correct flag
}
if (in_array($m_o1, $multiple_answer)) {
    $actual_flag2 = 1; // student's selected correct flag
}
if (in_array($m_o2, $multiple_answer)) {
    $actual_flag2 = 2; // student's selected correct flag
}
if (in_array($m_o3, $multiple_answer)) {
    $actual_flag2 = 3; // student's selected correct flag
}
if (in_array($m_o4, $multiple_answer)) {
    $actual_flag2 = 4; // student's selected correct flag
}
if (in_array($m_o5, $multiple_answer)) {
    $actual_flag2 = 5; // student's selected correct flag
}
?>
<?php if ($sc_flag2 == 1) { // correct answer by student green// see for correct option I had added green border and bg but tht time alps yello bg oisk showingokok ?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else if ($actual_flag2 == 1 && $correct_flag2 != 1) { // student's answer is wrong here and student answer is given red
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else if ($correct_flag2 == 1) { // student have not given answer and correct option will be yellow ?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o1; ?>" ></span> (A) <?php echo $m_o1; ?>
    </label>
<?php }?><br/><br/>
<?php if ($sc_flag2 == 2) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if ($actual_flag2 == 2 && $correct_flag2 != 2) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if ($correct_flag2 == 2) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o2; ?>" ></span> (B) <?php echo $m_o2; ?>
    </label>
<?php }?><br/><br/>
<?php if ($sc_flag2 == 3) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if ($actual_flag2 == 3 && $correct_flag2 != 3) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if ($correct_flag2 == 3) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o3; ?>" ></span> (C) <?php echo $m_o3; ?>
    </label>
<?php }?><br/><br/>
<?php if ($sc_flag2 == 4) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if ($actual_flag2 == 4 && $correct_flag2 != 4) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if ($correct_flag2 == 4) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o4; ?>" ></span> (D) <?php echo $m_o4; ?>
    </label>
<?php }?><br/><br/>
<?php if ($sc_flag2 == 5) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if ($actual_flag2 == 5 && $correct_flag2 != 5) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if ($correct_flag2 == 5) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o5; ?>" ></span> (D) <?php echo $m_o5; ?>
    </label>
<?php }?><br/><br/>
学生给出的答案,我们需要比较这些选项

$multiple_answers=数组([0]=>同一区域内较大的动物可能会腾出洞穴让猫鼬呆在里面。[1]=>猫鼬以独特的方式挖掘洞穴,大约有15个入口和出口洞。[2]=>未定义[3]=>未定义[4]=>未定义)

我正确的回答是2=Array([0]=>猫鼬为了自身的安全和舒适,与团队成员表现出强烈的团结。[1]=>有组织的生活方式和独特的身体结构帮助猫鼬在四肢过着舒适的生活。

这是我想要的结果


[0]=>同一地区的大型动物可能会腾出洞穴,让猫鼬呆在里面。[1] =>猫鼬以独特的方式挖掘它们的洞穴,大约有15个入口和出口孔。这两个选项的值用红色表示。[0]=>猫鼬的选项表明,为了他们的安全和舒适,猫鼬与他们的团队成员团结一致。[1]=>有组织的生活方式和独特的身体结构有助于猫鼬在四肢过上舒适的生活。黄色。但我得到的结果是错误的。请检查我的代码,让我知道错误是什么?请任何人帮助我摆脱这个问题。提前谢谢。谢谢你。你必须将旗帜声明为数组,并将选项推送到该数组,这样,如果有多个选项,则存储的值不会被替换。在国旗上

<?php 
$options = [trim($m_o1), trim($m_o2), trim($m_o3), trim($m_o4), trim($m_o5)];
shuffle($a1);
$b1      = ['m_o1', 'm_o2', 'm_o3', 'm_o4' ,'m_o5'];
$result1 = array_combine($b1, $options);
extract($result1);
$sc_flag2= array();
$actual_flag2=  array();
$correct_flag2= array();
if($m_c1=='1')
{
    $correct_options = array(
        $m_oo1,
        ' ',
        ' ',
        ' ',
        ' '
    );

}
else if($m_c1=='2')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        ' ',
        ' ',
        ' '
    );

}
else if($m_c1=='3')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        ' ',
        ' '
    );

}
else if($m_c1=='4')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4,
        ' '
    );

}
else if($m_c1=='5')
{
$correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4,
        $m_oo5
    );

}
else
{
    $correct_options = array('','','','','');

}

$selected_options = array(
        $multiple_answer_1_1,
        $multiple_answer_1_2,
        $multiple_answer_1_3,
        $multiple_answer_1_4,
        $multiple_answer_1_5
    );

if (in_array($m_o1, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 1);
}
if (in_array($m_o2, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 2);
}
if (in_array($m_o3, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 3);
}
if (in_array($m_o4, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 4);
}
if (in_array($m_o5, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 5);
}
if (in_array($m_o1, $correct_options)) {

    array_push($correct_flag2, 1); 
}
if (in_array($m_o2, $correct_options)) {
    array_push($correct_flag2, 2);
 }
if (in_array($m_o3, $correct_options)) {
    array_push($correct_flag2, 3);
}
     array_push($actual_flag2, 1);
}
if (in_array($m_o2, $selected_options)) {
     array_push($actual_flag2, 2);
}
if (in_array($m_o3, $selected_options)) {
 array_push($actual_flag2, 3);
}
if (in_array($m_o4, $selected_options)) {
 array_push($actual_flag2, 4);
}
if (in_array($m_o5, $selected_options)) {
     array_push($actual_flag2, 5);
}
?>
<?php if (in_array(1, $sc_flag2)) { ?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label> 
<?php } else if (in_array(1, $actual_flag2) && !in_array(1, $correct_flag2)) { 
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else if (in_array(1, $correct_flag2)) { ?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o1; ?>" ></span> (A) <?php echo $m_o1; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(2, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if (in_array(2, $actual_flag2) && !in_array(2, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if (in_array(2, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o2; ?>" ></span> (B) <?php echo $m_o2; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(3, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if (in_array(3, $actual_flag2) && !in_array(3, $correct_flag2)){
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if (in_array(3, $correct_flag2)){?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o3; ?>" ></span> (C) <?php echo $m_o3; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(4, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if (in_array(4, $actual_flag2) && !in_array(4, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if (in_array(4, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o4; ?>" ></span> (D) <?php echo $m_o4; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(5, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if (in_array(5, $actual_flag2) && !in_array(5, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if (in_array(5, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o5; ?>" ></span> (E) <?php echo $m_o5; ?>
    </label>
<?php }?>

(A)
(A)
(A)

如果你能在赏金中添加这个问题,我想你会更快得到帮助。我们如何在你的问题下方添加赏金,你应该能够看到开始赏金选项。。一个问题必须开放2天,然后才能设置悬赏。更多信息-我可以看到唯一符合悬赏tmw条件的问题
<?php 
$options = [trim($m_o1), trim($m_o2), trim($m_o3), trim($m_o4), trim($m_o5)];
shuffle($a1);
$b1      = ['m_o1', 'm_o2', 'm_o3', 'm_o4' ,'m_o5'];
$result1 = array_combine($b1, $options);
extract($result1);
$sc_flag2= array();
$actual_flag2=  array();
$correct_flag2= array();
if($m_c1=='1')
{
    $correct_options = array(
        $m_oo1,
        ' ',
        ' ',
        ' ',
        ' '
    );

}
else if($m_c1=='2')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        ' ',
        ' ',
        ' '
    );

}
else if($m_c1=='3')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        ' ',
        ' '
    );

}
else if($m_c1=='4')
{
    $correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4,
        ' '
    );

}
else if($m_c1=='5')
{
$correct_options = array(
        $m_oo1,
        $m_oo2,
        $m_oo3,
        $m_oo4,
        $m_oo5
    );

}
else
{
    $correct_options = array('','','','','');

}

$selected_options = array(
        $multiple_answer_1_1,
        $multiple_answer_1_2,
        $multiple_answer_1_3,
        $multiple_answer_1_4,
        $multiple_answer_1_5
    );

if (in_array($m_o1, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 1);
}
if (in_array($m_o2, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 2);
}
if (in_array($m_o3, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 3);
}
if (in_array($m_o4, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 4);
}
if (in_array($m_o5, $correct_options) && in_array($correct_options, $selected_options)) {
     array_push($sc_flag2, 5);
}
if (in_array($m_o1, $correct_options)) {

    array_push($correct_flag2, 1); 
}
if (in_array($m_o2, $correct_options)) {
    array_push($correct_flag2, 2);
 }
if (in_array($m_o3, $correct_options)) {
    array_push($correct_flag2, 3);
}
     array_push($actual_flag2, 1);
}
if (in_array($m_o2, $selected_options)) {
     array_push($actual_flag2, 2);
}
if (in_array($m_o3, $selected_options)) {
 array_push($actual_flag2, 3);
}
if (in_array($m_o4, $selected_options)) {
 array_push($actual_flag2, 4);
}
if (in_array($m_o5, $selected_options)) {
     array_push($actual_flag2, 5);
}
?>
<?php if (in_array(1, $sc_flag2)) { ?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label> 
<?php } else if (in_array(1, $actual_flag2) && !in_array(1, $correct_flag2)) { 
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else if (in_array(1, $correct_flag2)) { ?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(A) <?php echo $m_o1; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o1; ?>" ></span> (A) <?php echo $m_o1; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(2, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if (in_array(2, $actual_flag2) && !in_array(2, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else if (in_array(2, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(B) <?php echo $m_o2; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o2; ?>" ></span> (B) <?php echo $m_o2; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(3, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if (in_array(3, $actual_flag2) && !in_array(3, $correct_flag2)){
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else if (in_array(3, $correct_flag2)){?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(C) <?php echo $m_o3; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o3; ?>" ></span> (C) <?php echo $m_o3; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(4, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if (in_array(4, $actual_flag2) && !in_array(4, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else if (in_array(4, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(D) <?php echo $m_o4; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o4; ?>" ></span> (D) <?php echo $m_o4; ?>
    </label>
<?php }?><br/><br/>
<?php if (in_array(5, $sc_flag2)) {?>
    <label style="font-size:14px;background-color:#90EE90;border:1px solid green;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if (in_array(5, $actual_flag2) && !in_array(5, $correct_flag2)) {
    ?>
    <label style="font-size:14px;background-color:lightgray;border:1px solid red;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-times" style="color:red;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else if (in_array(5, $correct_flag2)) {?>
    <label style="font-size:14px;background-color:yellow;border:1px solid yellow;padding:10px" >
        <label class="review-icon"><i class="fa fa-fw fa-check-circle-o" style="color:green;font-size:15px"></i></label>
        <span class="">(E) <?php echo $m_o5; ?>
    </label>
<?php } else {?>
    <label style="font-size:14px">
        <span class=""><input type="checkbox" value="<?php echo $m_o5; ?>" ></span> (E) <?php echo $m_o5; ?>
    </label>
<?php }?>