Commit 09a6a1af authored by tecnickcom's avatar tecnickcom
Browse files

12.1.024 (2014-06-11)

- An unused paramer was removed.
- OMR scan was improved.
- TCPDF library was updated.
parent 8ffcd997
12.1.024 (2014-06-11)
- An unused paramer was removed.
- OMR scan was improved.
- TCPDF library was updated.
12.1.023 (2014-05-14)
- Some language typos were fixed.
......
......@@ -9,9 +9,9 @@ YOU MUST CONTACT INFO@TECNICK.COM TO PURCHASE A LICENSE.
Name: TCExam
Version: 12.1.023
Version: 12.1.024
Release date: 2014-05-14
Release date: 2014-06-11
Author:
Nicola Asuni
......
......@@ -155,7 +155,7 @@ function F_send_report_emails($test_id, $user_id=0, $testuser_id=0, $group_id=0,
}
if ($mode == 0) {
$pdfkey = getPasswordHash(date('Y').$tu['id'].K_RANDOM_SECURITY.$tu['test']['test_id'].date('m').$tu['user_id'], true);
$pdfkey = getPasswordHash(date('Y').$tu['id'].K_RANDOM_SECURITY.$tu['test']['test_id'].date('m').$tu['user_id']);
// create PDF doc
$mode = 3;
$pdf_content = file_get_contents(K_PATH_HOST.K_PATH_TCEXAM.'admin/code/tce_pdf_results.php?mode='.$mode.'&diplay_mode='.$display_mode.'&show_graph='.$show_graph.'&test_id='.$tu['test']['test_id'].'&user_id='.$tu['user_id'].'&testuser_id='.$tu['id'].'&email='.$pdfkey);
......
......@@ -2,7 +2,7 @@
//============================================================+
// File name : tce_functions_omr.php
// Begin : 2011-05-17
// Last Update : 2013-05-21
// Last Update : 2014-06-11
//
// Description : Functions to import test data from scanned
// OMR (Optical Mark Recognition) sheets.
......@@ -16,7 +16,7 @@
// info@tecnick.com
//
// License:
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
// Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
// See LICENSE.TXT file for more information.
//============================================================+
......@@ -108,46 +108,17 @@ function F_decodeOMRPage($image) {
$img->cropImage($w, $w, 0, $y);
$img->setImagePage(0, 0, 0, 0);
}
// trim image
$imgtmp = clone $img;
$color = '#606060';
$img->blackthresholdImage("$color");
$img->whitethresholdImage("$color");
$img->trimImage(85);
$imgpage = $img->getImagePage();
$w = $img->getImageWidth();
$h = $img->getImageHeight();
$img = clone $imgtmp;
$imgtmp->clear();
$img->cropImage($w, $h, $imgpage['x'], $imgpage['y']);
$img->setImagePage(0, 0, 0, 0);
// increase contrast
$img->normalizeImage(Imagick::CHANNEL_ALL);
$img->enhanceImage();
$img->despeckleImage();
// straighten image
//$img->deskewImage(40);
$img->setImagePage(0, 0, 0, 0);
// trim image (remove white border)
$imgtmp = clone $img;
$color = '#606060';
$img->blackthresholdImage("$color");
$img->whitethresholdImage("$color");
$img->blackthresholdImage('#808080');
$img->whitethresholdImage('#808080');
$img->trimImage(85);
$img->deskewImage(15);
$img->trimImage(85);
$imgpage = $img->getImagePage();
$w = $img->getImageWidth();
$h = $img->getImageHeight();
$img = clone $imgtmp;
$imgtmp->clear();
$img->cropImage($w, $h, $imgpage['x'], $imgpage['y']);
$img->setImagePage(0, 0, 0, 0);
// resize image
$img->resizeImage(1028, 1052, Imagick::FILTER_CUBIC, 1);
$img->setImagePage(0, 0, 0, 0);
// binarize image
$color = '#c0c0c0';
$img->blackthresholdImage("$color");
$img->whitethresholdImage("$color");
//$img->writeImage(K_PATH_CACHE.'_DEBUG_OMR_.PNG'); // DEBUG
// scan block width
$blkw = 16;
// starting column in pixels
......
......@@ -54,7 +54,7 @@ if (isset($_REQUEST['mode']) AND ($_REQUEST['mode'] > 0)) {
$mode = 0;
}
$onlytext = ($mode == 5);
if (isset($_REQUEST['email']) AND ($_REQUEST['email'] != getPasswordHash(date('Y').$testuser_id.K_RANDOM_SECURITY.$test_id.date('m').$user_id, true))) {
if (isset($_REQUEST['email']) AND ($_REQUEST['email'] != getPasswordHash(date('Y').$testuser_id.K_RANDOM_SECURITY.$test_id.date('m').$user_id))) {
F_print_error('ERROR', $l['m_authorization_denied']);
exit;
}
......
......@@ -55,7 +55,7 @@ if (isset($_REQUEST['mode']) AND ($_REQUEST['mode'] > 0)) {
$mode = 0;
}
$onlytext = ($mode == 5);
if (isset($_REQUEST['email']) AND ($_REQUEST['email'] != getPasswordHash(date('Y').$testuser_id.K_RANDOM_SECURITY.$test_id.date('m').$user_id, true))) {
if (isset($_REQUEST['email']) AND ($_REQUEST['email'] != getPasswordHash(date('Y').$testuser_id.K_RANDOM_SECURITY.$test_id.date('m').$user_id))) {
F_print_error('ERROR', $l['m_authorization_denied']);
exit;
}
......
......@@ -216,10 +216,9 @@ function getNewSessionID() {
/**
* Hash password for Database storing.
* @param $password (string) Password to hash.
* @param $force (boolean) If true always use strong encryption.
* @return string password hash
*/
function getPasswordHash($password, $force=false) {
function getPasswordHash($password) {
if (defined('K_STRONG_PASSWORD_ENCRYPTION') AND K_STRONG_PASSWORD_ENCRYPTION) {
$pswlen = strlen($password);
$salt = (2 * $pswlen);
......
......@@ -32,7 +32,7 @@
/**
* TCExam version (do not change).
*/
define ('K_TCEXAM_VERSION', '12.1.023');
define ('K_TCEXAM_VERSION', '12.1.024');
/**
* 2-letters code for default language.
......
6.0.083 (2014-05-29)
- Bug item #928 "setHtmlVSpace with HR element" was fixed.
6.0.082 (2014-05-23)
- Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed.
- Bug item #925 "924 transparent images bug" was fixed.
......
......@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 6.0.082
Release date: 2014-05-23
Version: 6.0.083
Release date: 2014-05-29
Author: Nicola Asuni
Copyright (c) 2002-2014:
......
......@@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
private static $tcpdf_version = '6.0.082';
private static $tcpdf_version = '6.0.083';
/**
* String alias for total number of pages.
......
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.082
// Version : 6.0.083
// Begin : 2002-08-03
// Last Update : 2014-05-23
// Last Update : 2014-05-29
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
......@@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.082
* @version 6.0.083
*/
 
// TCPDF configuration
......@@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.php');
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 6.0.082
* @version 6.0.083
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
......@@ -18682,18 +18682,18 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$cur_h = $this->getCellHeight($this->FontSize);
}
if (isset($this->tagvspaces[$tag['value']][0]['n'])) {
$n = $this->tagvspaces[$tag['value']][0]['n'];
$on = $this->tagvspaces[$tag['value']][0]['n'];
} elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) {
$n = 0.6;
$on = 0.6;
} else {
$n = 1;
$on = 1;
}
if ((!isset($this->tagvspaces[$tag['value']])) AND (in_array($tag['value'], array('div', 'dt', 'dd', 'li', 'br')))) {
if ((!isset($this->tagvspaces[$tag['value']])) AND (in_array($tag['value'], array('div', 'dt', 'dd', 'li', 'br', 'hr')))) {
$hb = 0;
} else {
$hb = ($n * $cur_h);
$hb = ($on * $cur_h);
}
if (($this->htmlvspace <= 0) AND ($n > 0)) {
if (($this->htmlvspace <= 0) AND ($on > 0)) {
if (isset($parent['fontsize'])) {
$hbz = (($parent['fontsize'] / $this->k) * $this->cell_height_ratio);
} else {
......@@ -18704,6 +18704,25 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// fix vertical space after table
$hbz = 0;
}
// closing vertical space
$hbc = 0;
if (isset($this->tagvspaces[$tag['value']][1]['h']) AND ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) {
$pre_h = $this->tagvspaces[$tag['value']][1]['h'];
} elseif (isset($parent['fontsize'])) {
$pre_h = $this->getCellHeight($parent['fontsize'] / $this->k);
} else {
$pre_h = $this->getCellHeight($this->FontSize);
}
if (isset($this->tagvspaces[$tag['value']][1]['n'])) {
$cn = $this->tagvspaces[$tag['value']][1]['n'];
} elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) {
$cn = 0.6;
} else {
$cn = 1;
}
if (isset($this->tagvspaces[$tag['value']][1])) {
$hbc = ($cn * $pre_h);
}
}
// Opening tag
switch($tag['value']) {
......@@ -18760,7 +18779,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} else {
$hrHeight = $this->GetLineWidth();
}
$this->addHTMLVertSpace($hbz, ($hrHeight / 2), $cell, $firsttag);
$this->addHTMLVertSpace($hbz, max($hb, ($hrHeight / 2)), $cell, $firsttag);
$x = $this->GetX();
$y = $this->GetY();
$wtmp = $this->w - $this->lMargin - $this->rMargin;
......@@ -18776,7 +18795,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->SetLineWidth($hrHeight);
$this->Line($x, $y, $x + $hrWidth, $y);
$this->SetLineWidth($prevlinewidth);
$this->addHTMLVertSpace(($hrHeight / 2), 0, $cell, !isset($dom[($key + 1)]));
$this->addHTMLVertSpace(max($hbc, ($hrHeight / 2)), 0, $cell, !isset($dom[($key + 1)]));
break;
}
case 'a': {
......@@ -19334,16 +19353,16 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$pre_h = $this->getCellHeight($this->FontSize);
}
if (isset($this->tagvspaces[$tag['value']][1]['n'])) {
$n = $this->tagvspaces[$tag['value']][1]['n'];
$cn = $this->tagvspaces[$tag['value']][1]['n'];
} elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) {
$n = 0.6;
$cn = 0.6;
} else {
$n = 1;
$cn = 1;
}
if ((!isset($this->tagvspaces[$tag['value']])) AND ($tag['value'] == 'div')) {
$hb = 0;
} else {
$hb = ($n * $pre_h);
$hb = ($cn * $pre_h);
}
if ($maxbottomliney > $this->PageBreakTrigger) {
$hbz = $this->getCellHeight($this->FontSize);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment