Skip to content

Commit

Permalink
12.0.007 (2013-04-09)
Browse files Browse the repository at this point in the history
- Automatic "onchange" update on Test Results Summary form was disabled - now you have to press the select button to update results.
- Test selection queries were fixed for postgresql.
- OMR page generation was fixed for some languages.
- New config.default configuration directories were added on admin, public and shared folders to avoid overriding the existing configuration files during "git pull".
  • Loading branch information
Nicola Asuni committed Apr 9, 2013
1 parent 3385360 commit 1ccfb79
Show file tree
Hide file tree
Showing 32 changed files with 49,061 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
admin/config/
shared/config/
public/config/
6 changes: 6 additions & 0 deletions CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
12.0.007 (2013-04-09)
- Automatic "onchange" update on Test Results Summary form was disabled - now you have to press the select button to update results.
- Test selection queries were fixed for postgresql.
- OMR page generation was fixed for some languages.
- New config.default configuration directories were added on admin, public and shared folders to avoid overriding the existing configuration files during "git pull".

12.0.006 (2013-04-08)
- Fixing some SQL queries and result values.

Expand Down
4 changes: 2 additions & 2 deletions README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ FOR ANY COMMERCIAL USAGE PLEASE CONTACT: [email protected]

Name: TCExam

Version: 12.0.006
Version: 12.0.007

Release date: 2013-04-08
Release date: 2013-04-09

Author:
Nicola Asuni
Expand Down
8 changes: 4 additions & 4 deletions admin/code/tce_pdf_testgen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//============================================================+
// File name : tce_pdf_testgen.php
// Begin : 2004-06-13
// Last Update : 2012-12-28
// Last Update : 2013-04-09
//
// Description : Creates PDF documents for offline testing.
//
Expand Down Expand Up @@ -794,14 +794,14 @@
// select circle
$pdf->Circle($x + $circle_half_width, $cy, $circle_radius, 0, 360, 'DF', $line_style, $circle_bg_color, 2);
$pdf->SetXY($x,$y);
$pdf->SetFont('helvetica', '', 6);
$pdf->SetFont(PDF_FONT_NAME_DATA, '', 6);
$pdf->SetTextColorArray($grid_bg_color);
$pdf->Cell($circle_width, $circle_width, $l['w_true_acronym'], 0, 0, 'C', false, '', 0, true, 'T', 'M');
$pdf->Cell($circle_width, $circle_width, $l['w_true_acronym'], 0, 0, 'C', false, '', 1, true, 'T', 'M');
$x += $circle_shift;
if ($question_type == 2) { // MCMA question
$pdf->Circle($x + $circle_half_width, $cy, $circle_radius, 0, 360, 'DF', $line_style, $circle_bg_color, 2);
$pdf->SetXY($x,$y);
$pdf->Cell($circle_width, $circle_width, $l['w_false_acronym'], 0, 0, 'C', false, '', 0, true, 'T', 'M');
$pdf->Cell($circle_width, $circle_width, $l['w_false_acronym'], 0, 0, 'C', false, '', 1, true, 'T', 'M');

}
} else {
Expand Down
14 changes: 9 additions & 5 deletions admin/code/tce_select_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//============================================================+
// File name : tce_select_tests.php
// Begin : 2012-12-02
// Last Update : 2012-12-02
// Last Update : 2013-04-09
//
// Description : Display user selection table.
//
Expand Down Expand Up @@ -87,10 +87,14 @@
$terms = preg_split("/[\s]+/i", $searchterms); // Get all the words into an array
foreach ($terms as $word) {
$word = F_escape_sql($word);
$wherequery .= ' AND ((test_name LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_begin_time LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_end_time LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_description LIKE \'%'.$word.'%\'))';
$wherequery .= ' AND (';
$wherequery .= ' (test_name LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_description LIKE \'%'.$word.'%\')';
if ((preg_match('/^([0-9]{4})[\-]([0-9]{2})[\-]([0-9]{2})$/', $word, $wd) == 1) AND (checkdate($wd[2], $wd[3], $wd[1]))) {
$wherequery .= ' OR ((test_begin_time <= \''.$word.'\')';
$wherequery .= ' AND (test_end_time >= \''.$word.'\'))';
}
$wherequery .= ')';
}
$wherequery = '('.substr($wherequery, 5).')';
}
Expand Down
14 changes: 9 additions & 5 deletions admin/code/tce_select_tests_popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//============================================================+
// File name : tce_select_tests_popup.php
// Begin : 2012-12-02
// Last Update : 2012-12-02
// Last Update : 2013-04-09
//
// Description : Display user selection table on popup window.
//
Expand Down Expand Up @@ -86,10 +86,14 @@
$terms = preg_split("/[\s]+/i", $searchterms); // Get all the words into an array
foreach ($terms as $word) {
$word = F_escape_sql($word);
$wherequery .= ' AND ((test_name LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_begin_time LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_end_time LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_description LIKE \'%'.$word.'%\'))';
$wherequery .= ' AND (';
$wherequery .= ' (test_name LIKE \'%'.$word.'%\')';
$wherequery .= ' OR (test_description LIKE \'%'.$word.'%\')';
if ((preg_match('/^([0-9]{4})[\-]([0-9]{2})[\-]([0-9]{2})$/', $word, $wd) == 1) AND (checkdate($wd[2], $wd[3], $wd[1]))) {
$wherequery .= ' OR ((test_begin_time <= \''.$word.'\')';
$wherequery .= ' AND (test_end_time >= \''.$word.'\'))';
}
$wherequery .= ')';
}
$wherequery = '('.substr($wherequery, 5).')';
}
Expand Down
16 changes: 10 additions & 6 deletions admin/code/tce_show_result_allusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//============================================================+
// File name : tce_show_result_allusers.php
// Begin : 2004-06-10
// Last Update : 2013-01-20
// Last Update : 2013-04-09
//
// Description : Display test results summary for all users.
//
Expand All @@ -18,7 +18,7 @@
// [email protected]
//
// License:
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -223,7 +223,8 @@
echo '</span>'.K_NEWLINE;
echo '<span class="formw">'.K_NEWLINE;
echo '<input type="hidden" name="changecategory" id="changecategory" value="" />'.K_NEWLINE;
echo '<select name="test_id" id="test_id" size="0" onchange="document.getElementById(\'form_resultallusers\').changecategory.value=1; document.getElementById(\'form_resultallusers\').submit()" title="'.$l['h_test'].'">'.K_NEWLINE;
//echo '<select name="test_id" id="test_id" size="0" onchange="document.getElementById(\'form_resultallusers\').changecategory.value=1; document.getElementById(\'form_resultallusers\').submit()" title="'.$l['h_test'].'">'.K_NEWLINE;
echo '<select name="test_id" id="test_id" size="0" title="'.$l['h_test'].'">'.K_NEWLINE;
$sql = F_select_executed_tests_sql();
if ($r = F_db_query($sql, $db)) {
echo '<option value="0"';
Expand Down Expand Up @@ -261,7 +262,8 @@
echo '<label for="group_id">'.$l['w_group'].'</label>'.K_NEWLINE;
echo '</span>'.K_NEWLINE;
echo '<span class="formw">'.K_NEWLINE;
echo '<select name="group_id" id="group_id" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()">'.K_NEWLINE;
//echo '<select name="group_id" id="group_id" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()">'.K_NEWLINE;
echo '<select name="group_id" id="group_id" size="0">'.K_NEWLINE;
$sql = 'SELECT * FROM '.K_TABLE_GROUPS.'';
if ($test_id > 0) {
$sql .= ' WHERE group_id IN ('.$test_group_ids.')';
Expand Down Expand Up @@ -296,7 +298,8 @@
echo '<label for="user_id">'.$l['w_user'].'</label>'.K_NEWLINE;
echo '</span>'.K_NEWLINE;
echo '<span class="formw">'.K_NEWLINE;
echo '<select name="user_id" id="user_id" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()">'.K_NEWLINE;
//echo '<select name="user_id" id="user_id" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()">'.K_NEWLINE;
echo '<select name="user_id" id="user_id" size="0">'.K_NEWLINE;
$sql = 'SELECT user_id, user_lastname, user_firstname, user_name FROM '.K_TABLE_USERS.'';
if ($test_id > 0) {
$sql .= ', '.K_TABLE_TEST_USER.' WHERE testuser_user_id=user_id AND testuser_test_id='.$test_id.'';
Expand Down Expand Up @@ -339,7 +342,8 @@
echo '<label for="display_mode">'.$l['w_mode'].'</label>'.K_NEWLINE;
echo '</span>'.K_NEWLINE;
echo '<span class="formw">'.K_NEWLINE;
echo '<select name="display_mode" id="display_mode" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()" title="'.$l['w_mode'].'">'.K_NEWLINE;
//echo '<select name="display_mode" id="display_mode" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()" title="'.$l['w_mode'].'">'.K_NEWLINE;
echo '<select name="display_mode" id="display_mode" size="0" title="'.$l['w_mode'].'">'.K_NEWLINE;
foreach($detail_modes as $key => $dmode) {
echo '<option value="'.$key.'"';
if ($key == $display_mode) {
Expand Down
201 changes: 201 additions & 0 deletions admin/config.default/tce_auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
<?php
//============================================================+
// File name : tce_auth.php
// Begin : 2002-09-02
// Last Update : 2011-05-20
//
// Description : Define access levels for each admin page
// Note:
// 0 = Anonymous user (uregistered user)
// 1 = registered user
// 10 = System Administrator
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com LTD
// Manor Coach House, Church Hill
// Aldershot, Hants, GU12 4RQ
// UK
// www.tecnick.com
// [email protected]
//
// License:
// Copyright (C) 2004-2010 Nicola Asuni - Tecnick.com LTD
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Additionally, you can't remove, move or hide the original TCExam logo,
// copyrights statements and links to Tecnick.com and TCExam websites.
//
// See LICENSE.TXT file for more information.
//============================================================+

/**
* @file
* Configuration file: define access levels for each admin page.
* @package com.tecnick.tcexam.admin.cfg
* @author Nicola Asuni
* @since 2002-09-02
*/

// ************************************************************
// SECURITY WARNING :
// SET THIS FILE AS READ ONLY AFTER MODIFICATIONS
// ************************************************************

/**
* Administrator level.
*/
define ('K_AUTH_ADMINISTRATOR', 10);

/**
* Operator level.
*/
define ('K_AUTH_OPERATOR', 5);

/**
* Required user's level to access index page.
*/
define ('K_AUTH_INDEX', K_AUTH_OPERATOR);

/**
* Required user's level to access "user editor".
*/
define ('K_AUTH_ADMIN_USERS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to delete users.
*/
define ('K_AUTH_DELETE_USERS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to export users.
*/
define ('K_AUTH_EXPORT_USERS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to import users.
*/
define ('K_AUTH_IMPORT_USERS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to access "group editor".
*/
define ('K_AUTH_ADMIN_GROUPS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to delete user groups.
*/
define ('K_AUTH_DELETE_GROUPS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to move users from one group to another.
*/
define ('K_AUTH_MOVE_GROUPS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to access "tcecode editor".
*/
define ('K_AUTH_ADMIN_TCECODE', K_AUTH_OPERATOR);

/**
* Required user's level to access "module editor".
*/
define ('K_AUTH_ADMIN_MODULES', K_AUTH_OPERATOR);

/**
* Required user's level to access "subject editor".
*/
define ('K_AUTH_ADMIN_SUBJECTS', K_AUTH_OPERATOR);

/**
* Required user's level to access "question editor".
*/
define ('K_AUTH_ADMIN_QUESTIONS', K_AUTH_OPERATOR);

/**
* Required user's level to access "answer editor".
*/
define ('K_AUTH_ADMIN_ANSWERS', K_AUTH_OPERATOR);

/**
* Required user's level to access "test editor".
*/
define ('K_AUTH_ADMIN_TESTS', K_AUTH_OPERATOR);

/**
* Required user's level to access "TCExam information".
*/
define ('K_AUTH_ADMIN_INFO', 0);

/**
* Required user's level to display online users.
*/
define ('K_AUTH_ADMIN_ONLINE_USERS', K_AUTH_OPERATOR);

/**
* Required user's level to upload images.
*/
define ('K_AUTH_ADMIN_UPLOAD_IMAGES', K_AUTH_OPERATOR);

/**
* Required user's level to manually rate free text answers.
*/
define ('K_AUTH_ADMIN_RATING', K_AUTH_OPERATOR);

/**
* Required user's level to display results.
*/
define ('K_AUTH_ADMIN_RESULTS', K_AUTH_OPERATOR);

/**
* Required user's level to import questions.
*/
define ('K_AUTH_ADMIN_IMPORT', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to import OMR answers.
*/
define ('K_AUTH_ADMIN_OMR_IMPORT', K_AUTH_OPERATOR);

/**
* Required user's level to import questions.
*/
define ('K_AUTH_BACKUP', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to access file manager for multimedia files.
*/
define ('K_AUTH_ADMIN_FILEMANAGER', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to create and delete directories.
*/
define ('K_AUTH_ADMIN_DIRS', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to delete multimedia files.
*/
define ('K_AUTH_DELETE_MEDIAFILE', K_AUTH_ADMINISTRATOR);

/**
* Required user's level to rename multimedia files.
*/
define ('K_AUTH_RENAME_MEDIAFILE', K_AUTH_ADMINISTRATOR);

//============================================================+
// END OF FILE
//============================================================+
Loading

0 comments on commit 1ccfb79

Please sign in to comment.