本文整理汇总了PHP中Evaluation类的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation类的具体用法?PHP Evaluation怎么用?PHP Evaluation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Evaluation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVotePercentage
/**
*
* @param Evaluation $evalObj
*/
private function getVotePercentage($evalObj)
{
$questionCount = count($evalObj->getQuestions());
$votes = $evalObj->getVotes();
$currentVotes = array();
$usersVoted = array();
foreach ($votes as $vote) {
array_push($currentVotes, $vote->getVote());
array_push($usersVoted, $vote->getUser()->getId());
}
$sum = array_sum($currentVotes);
$users = count(array_unique($usersVoted));
return $sum / ($questionCount * 5) * 100 / $users;
}
示例2: getList
public static function getList($nurser_id = '')
{
$model = Evaluation::model();
$command = $model->getDbConnection()->CreateCommand();
$condition = "c.id=b.order_id And a.id=b.customer_id And b.nurser_id={$nurser_id}";
return $command->select('a.name,c.server_name,b.context,b.create_time,b.id')->from('t_customer a, t_evaluation b, t_order c')->where($condition)->order('b.create_time DESC')->queryAll();
}
示例3: run
public function run($id)
{
$evaluation_info = Evaluation::model()->findByPk($id);
if ($evaluation_info->delete()) {
$this->controller->success('');
}
}
示例4: destroy
public function destroy($id)
{
$evaluation = Evaluation::find($id);
$evaluation->delete();
Session::flash('message', 'Successfully deleted the Evaluations!');
return Redirect::to('evaluations');
}
示例5: run
public function run()
{
$nurser_id = Yii::app()->request->getParam('id', 0);
$evaluation_model = Evaluation::getList($nurser_id);
//print_r($evaluation_model);die;
$vars = array('evaluation_model' => $evaluation_model);
$this->controller->render('index', $vars);
}
示例6: evaluateAction
public function evaluateAction()
{
$username = $this->_getParam('username');
if (!empty($username)) {
$form = $this->_getEvaluationForm($username);
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
$values = $form->getValues();
require_once APPLICATION_PATH . "/model/Evaluation.php";
$table = new Evaluation();
$date = new Zend_Date();
$data['date'] = $date->getIso();
$data['rating'] = $values['rating'];
$data['motivation'] = $values['motivation'];
$data['evaluator'] = Zend_Auth::getInstance()->getIdentity()->username;
$data['evaluated_user'] = $username;
$table->insert($data);
$this->_helper->redirector('profile', 'user', 'default', array('username' => $username, 'evaluationInserted' => true));
}
$this->view->form = $form;
}
}
示例7: update
public function update($id)
{
// Validate
// read more on validation at http://laravel.com/docs/validation
$rules = array('eva_name' => 'required', 'eva_duration' => 'required');
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('evaluations/' . $id . '/edit')->withErrors($validator);
} else {
// store
$evaluation = new Evaluation();
$evaluation->eva_name = Input::get('eva_name');
$evaluation->eva_duration = Input::get('eva_duration');
$evaluation->questions_id = Input::get('questions_id');
$evaluation->save();
// Redirect
Session::flash('message', 'Successfully created Evaluation!');
return Redirect::to('evaluations');
}
}
示例8: afficheEvaluation
/**
* @param $eleve
* @param $trimestre
*/
function afficheEvaluation(Eleve $eleve, Trimestre $trimestre, $idMatiere)
{
$evaluations = Evaluation::getByMatiereTrimestre($idMatiere, $trimestre->getIdTrimestre());
if (count($evaluations) > 0) {
foreach ($evaluations as $uneEvaluation) {
$laNote = Note::getById($eleve->getIdEleve(), $uneEvaluation->getIdEvaluation());
if (!empty($laNote->getNote())) {
echo '<tr>
<td colspan="3"></td>
<td class="Evaluation">' . $uneEvaluation->getLibelleEvaluation() . '</td>';
afficheNote($uneEvaluation->getMaxEvaluation(), $laNote->getNote());
echo '</tr>';
}
}
}
}
示例9: get_evaluations_with_result_for_student
/**
* Retrieve evaluations where a student has results for
* and return them as an array of Evaluation objects
* @param int $cat_id parent category (use 'null' to retrieve them in all categories)
* @param int $stud_id student id
*/
public static function get_evaluations_with_result_for_student($cat_id = null, $stud_id)
{
$tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
$sql = 'SELECT * FROM ' . $tbl_grade_evaluations . '
WHERE id IN (
SELECT evaluation_id FROM ' . $tbl_grade_results . '
WHERE user_id = ' . intval($stud_id) . ' AND score IS NOT NULL
)';
if (!api_is_allowed_to_edit()) {
$sql .= ' AND visible = 1';
}
if (isset($cat_id)) {
$sql .= ' AND category_id = ' . intval($cat_id);
} else {
$sql .= ' AND category_id >= 0';
}
$result = Database::query($sql);
$alleval = Evaluation::create_evaluation_objects_from_sql_result($result);
return $alleval;
}
示例10: set_time_limit
<?php
set_time_limit(0);
$strPageTitle = 'Add Image';
include "../includes/logincheck.php";
if (!empty($_FILES)) {
$objEvaluation = new Evaluation(NULL, NULL);
$arrImageAdded = $objEvaluation->addImage(isset($_POST['imageid']) ? $_POST['imageid'] : NULL, isset($_POST['evalid']) ? $_POST['evalid'] : NULL);
if (!empty($arrImageAdded) && $arrImageAdded != 'error') {
echo $arrImageAdded[0];
} else {
echo 'error';
}
}
示例11: ini_set
<?php
include "../includes/logincheck.php";
if (!empty($_POST)) {
if (!empty($_POST['download-pdf'])) {
if (!ini_get('display_errors')) {
ini_set('display_errors', '1');
}
require_once '../includes/html2pdf_v4.03/html2pdf.class.php';
$iEvaluationId = $_POST['evaluation-id'];
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$username = 'dev';
$password = 'bradf0rd1911';
$context = stream_context_create(array('http' => array('header' => "Authorization: Basic " . base64_encode("{$username}:{$password}"))));
$content = file_get_contents('http://jamestoothill.co.uk/dev/eval/admin/view_eval_pdf.php?skip_auth=1HGstGtw8272891H&eval_id=' . $iEvaluationId . '&remove_formatting=true', false, $context);
$objEvaluation = new Evaluation(NULL, NULL);
$objEvaluation->emailEvaluation('jimmytootall3@gmail.com', 'James Toothill', $content);
//echo $content;
//$html2pdf->WriteHTML($content);
//$html2pdf->Output('exemple.pdf');
exit;
}
}
示例12: get_evaluation
/**
* Lazy load function to get the linked evaluation
*/
protected function get_evaluation()
{
if (!isset($this->evaluation)) {
if (isset($this->ref_id)) {
$evalarray = Evaluation::load($this->get_ref_id());
$this->evaluation = $evalarray[0];
} else {
$eval = new Evaluation();
$eval->set_category_id(-1);
$eval->set_date(api_get_utc_datetime());
// these values will be changed
$eval->set_weight(0);
// when the link setter
$eval->set_visible(0);
// is called
$eval->set_id(-1);
// a 'real' id will be set when eval is added to db
$eval->set_user_id($this->get_user_id());
$eval->set_course_code($this->get_course_code());
$this->evaluation = $eval;
$this->set_ref_id($eval->get_id());
}
}
return $this->evaluation;
}
示例13: elseif
# ===================================================== END: check the evalID #
# check the itemID ========================================================= #
$itemID = Request::option('itemID');
if ($itemID) {
$_SESSION['itemID'] = $itemID;
} elseif (Request::submitted('newButton')) {
$_SESSION['itemID'] = "root";
}
# ===================================================== END: check the itemID #
# check the rangeID ======================================================== #
if (Request::option("rangeID")) {
$_SESSION['rangeID'] = Request::option("rangeID");
}
# ==================================================== END: check the rangeID #
# EVTAU: employees of the vote-team against urlhacking ====================== #
$eval = new Evaluation($evalID, NULL, EVAL_LOAD_NO_CHILDREN);
// someone has voted
if ($eval->hasVoted()) {
$error = EvalCommon::createReportMessage(_("An dieser Evaluation hat bereits jemand teilgenommen. Sie darf nicht mehr verändert werden."), EVAL_PIC_ERROR, EVAL_CSS_ERROR);
$error_msgs[] = $error->createContent();
}
// only the author or user with tutor perm in all evalRangeIDs should edit an eval
$authorID = $eval->getAuthorID();
$db = new EvaluationObjectDB();
if ($authorID != $user->id) {
$no_permisson = 0;
if (is_array($eval->getRangeIDs())) {
foreach ($eval->getRangeIDs() as $rangeID) {
$user_perm = $db->getRangePerm($rangeID, $user->id, YES);
// every range with a lower perm than Tutor
if ($user_perm < 7) {
示例14: Evaluation
if (isset($_POST['selectEval']) && !empty($_POST['selectEval']))
header('location: ../Intranet/modifCpt.php?idEval='.$_POST['selectEval']);
}
if (isset($_POST['verif'])){
if (isset($_POST['selectEval']) && !empty($_POST['selectEval']))
header('location: ../Intranet/verifNote.php?idEval='.$_POST['selectEval']);
}
if (isset($_POST['noter'])){
if (isset($_POST['selectEval']) && !empty($_POST['selectEval']))
header('location: ../Intranet/affectNote.php?idEval='.$_POST['selectEval']);
}
if (isset($_POST['btAjouter'])) {
$evaluation = new Evaluation();
$evaluation->setDateEvaluation($_POST['addDate']);
$evaluation->setIdMatiereNiveau(MatiereNiveau::getByMatiereNiveau($_POST['addMatiere'], $_POST['addNiveau'])->getIdMatiereNiveau());
$evaluation->setIdTypeEvaluation($_POST['addType']);
$evaluation->setTitreEvaluation(db_connect::escape_string($_POST['addTitre']));
// echo $evaluation->getTitreEvaluation();
$evaluation->setMaxEvaluation($_POST['addMax']);
if ($evaluation->getIdTypeEvaluation() == 3)
$evaluation->setAutreEvaluation(db_connect::escape_string($_POST['autreEval']));
if ($evaluation->insert()){
$msgInsert = "<h4 style='color: green'>
L'ajout de l'évaluation a réussi.
</h4>";
}
else{
示例15: api_block_anonymous_users
* @package chamilo.gradebook
*/
require_once '../inc/global.inc.php';
api_block_anonymous_users();
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(api_get_user_id(), api_get_course_info());
if (!$isDrhOfCourse) {
GradebookUtils::block_students();
}
$interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
//load the evaluation & category
$select_eval = Security::remove_XSS($_GET['selecteval']);
if (empty($select_eval)) {
api_not_allowed();
}
$displayscore = ScoreDisplay::instance();
$eval = Evaluation::load($select_eval);
$overwritescore = 0;
if ($eval[0]->get_category_id() < 0) {
// if category id is negative, then the evaluation's origin is a link
$link = LinkFactory::get_evaluation_link($eval[0]->get_id());
$currentcat = Category::load($link->get_category_id());
} else {
$currentcat = Category::load($eval[0]->get_category_id());
}
//load the result with the evaluation id
if (isset($_GET['delete_mark'])) {
$result = Result::load($_GET['delete_mark']);
if (!empty($result[0])) {
$result[0]->delete();
}
}