当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::selectScore方法代码示例

本文整理汇总了PHP中Exercise::selectScore方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::selectScore方法的具体用法?PHP Exercise::selectScore怎么用?PHP Exercise::selectScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exercise的用法示例。


在下文中一共展示了Exercise::selectScore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: intval

if (isset($_GET['exerciseId'])) {
    $exerciseId = intval($_GET['exerciseId']);
}

// if the object is not in the session
if (!isset($_SESSION['objExercise'][$exerciseId])) {
    // construction of Exercise
    $objExercise = new Exercise();
    // if the specified exercise doesn't exist or is disabled
    if (!$objExercise->read($exerciseId) && (!$is_editor)) {
        $tool_content .= "<p>$langExerciseNotFound</p>";
        draw($tool_content, 2);
        exit();
    }
    if(!$objExercise->selectScore() &&  !$is_editor) {
        redirect_to_home_page("modules/exercise/index.php?course=$course_code");
    }
}

if (isset($_SESSION['objExercise'][$exerciseId])) {
    $objExercise = $_SESSION['objExercise'][$exerciseId];
}

if ($is_editor && isset($_GET['purgeAttempID'])) {
    $eurid = $_GET['purgeAttempID'];
    $objExercise->purgeAttempt($eurid);
    Session::Messages($langPurgeExerciseResultsSuccess);
    redirect_to_home_page("modules/exercise/results.php?course=$course_code&exerciseId=$exerciseId");  
}
$exerciseTitle = $objExercise->selectTitle();
开发者ID:nikosv,项目名称:openeclass,代码行数:30,代码来源:results.php

示例2: Exercise

    }
    $objExercise = new Exercise();
    $objExercise->read($exercise_user_record->eid);
} else {
    //exercise user recird id is not set
    redirect_to_home_page('modules/exercise/index.php?course=' . $course_code);
}
if ($is_editor && $exercise_user_record->attempt_status == ATTEMPT_PENDING) {
    $head_content .= "<script type='text/javascript'>                             \n    \t\t\$(document).ready(function(){\n                    function save_grade(elem){\n                        var grade = parseInt(\$(elem).val());\n                        var element_name = \$(elem).attr('name');\n                        var questionId = parseInt(element_name.substring(14,element_name.length - 1));\n                        var questionMaxGrade = parseInt(\$(elem).next().val());\n                        if (grade > questionMaxGrade) {\n                            bootbox.alert('{$langGradeTooBig}');\n                            return false;\n                        } else if (isNaN(grade)){\n                            \$(elem).css({'border-color':'red'});\n                            return false;\n                        } else {\n                            \$.ajax({\n                              type: 'POST',\n                              url: '',\n                              data: {question_grade: grade, question_id: questionId},\n                            });\n                            \$(elem).parent().prev().hide();\n                            \$(elem).prop('disabled', true);\n                            \$(elem).css({'border-color':'#dfdfdf'});\n                            var prev_grade = parseInt(\$('span#total_score').html());\n                            var updated_grade = prev_grade + grade;\n                            \$('span#total_score').html(updated_grade);\n                            return true;\n                        }                    \n                    }\n                    \$('.questionGradeBox').keyup(function (e) {\n                        if (e.keyCode == 13) {\n                            save_grade(this);\n                            var countnotgraded = \$('input.questionGradeBox').not(':disabled').length;\n                            if (countnotgraded == 0) {\n                                \$('a#submitButton').hide();\n                                \$('a#all').hide();\n                                \$('a#ungraded').hide();\n                                \$('table.graded').show('slow');\n                            }                        \n                        }\n                    });\n                    \$('a#submitButton').click(function(e){\n                        e.preventDefault();\n                        var success = true;\n                        \$('.questionGradeBox').each(function() {\n                           success = save_grade(this);\n                        });\n                        if (success) {\n                         \$(this).parent().hide();\n                        }\n                    });                    \n                    \$('a#ungraded').click(function(e){\n                        e.preventDefault();\n                        \$('a#all').removeClass('btn-primary').addClass('btn-default');\n                        \$(this).removeClass('btn-default').addClass('btn-primary');\n                        \$('table.graded').hide('slow');\n                    });\n                    \$('a#all').click(function(e){\n                        e.preventDefault();\n                        \$('a#ungraded').removeClass('btn-primary').addClass('btn-default');\n                        \$(this).removeClass('btn-default').addClass('btn-primary');\n                        \$('table.graded').show('slow');\n                    });        \n                });\n                </script>";
}
$exerciseTitle = $objExercise->selectTitle();
$exerciseDescription = $objExercise->selectDescription();
$exerciseDescription_temp = nl2br(make_clickable($exerciseDescription));
$exerciseDescription_temp = mathfilter($exerciseDescription_temp, 12, "../../courses/mathimg/");
$displayResults = $objExercise->selectResults();
$displayScore = $objExercise->selectScore();
$tool_content .= "<div class='panel panel-primary'>\n  <div class='panel-heading'>\n    <h3 class='panel-title'>{$exerciseTitle}</h3>\n  </div>";
if (!empty($exerciseDescription_temp)) {
    $tool_content .= "<div class='panel-body'>\n        {$exerciseDescription_temp}\n      </div>";
}
$tool_content .= "</div>";
$tool_content .= "\n  <div class='row margin-bottom-fat'>\n    <div class='col-md-5 col-md-offset-7'>\n        " . ($is_editor && $exercise_user_record->attempt_status == ATTEMPT_PENDING ? "<div class='btn-group btn-group-sm' style='float:right;'><a class='btn btn-primary' id='all'>Όλες οι ερωτήσεις</a><a class='btn btn-default' id='ungraded'>Ερωτήσεις προς Βαθμολόγηση</a></div>" : "") . "\n    </div>    \n  </div>";
$i = 0;
// for each question
if (count($exercise_question_ids) > 0) {
    foreach ($exercise_question_ids as $row) {
        // creates a temporary Question object
        $objQuestionTmp = new Question();
        $objQuestionTmp->read($row->question_id);
        // gets the student choice for this question
        $choice = $objQuestionTmp->get_answers_record($eurid);
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:exercise_result.php


注:本文中的Exercise::selectScore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。