[svn r14543] Added tms datetime field to track_e_attempt (see FS#2320)

Reduced license header by pointing to file
skala
Yannick Warnier 17 years ago
parent 37ecca7464
commit 7749fe39c6
  1. 27
      main/inc/lib/database.lib.php
  2. 97
      main/inc/lib/events.lib.inc.php
  3. 3
      main/install/dokeos_stats.sql
  4. 1
      main/install/migrate-db-1.8.4-1.8.5-pre.sql
  5. 26
      main/install/update-db-1.8.4-1.8.5.inc.php
  6. 25
      main/install/update-files-1.8.4-1.8.5.inc.php

@ -1,28 +1,5 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2005 Dokeos S.A.
Copyright (c) Roan Embrechts, Vrije Universiteit Brussel
Copyright (c) Patrick Cool, Ghent University
Copyright (c) Yannick Warnier, Dokeos S.A.
Copyright (c) Bart Mollet, Hogeschool Gent
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
<?php // $Id: database.lib.php 14543 2008-03-09 17:32:54Z yannoo $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
* This is the main database library for Dokeos.

@ -1,27 +1,5 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Sebastien Piraux
Copyright (c) Toon Van Hoecke
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
<?php // $Id: events.lib.inc.php 14543 2008-03-09 17:32:54Z yannoo $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
* EVENTS LIBRARY
@ -437,11 +415,8 @@ function event_link($link_id)
*/
function event_exercice($exo_id, $score, $weighting)
{
global $_configuration;
global $_user;
global $_cid;
global $TABLETRACK_EXERCICES;
global $origin, $learnpath_id, $learnpath_item_id;
global $_configuration, $_user, $_cid;
$TABLETRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
// if tracking is disabled record nothing
if (!$_configuration['tracking_enabled'])
@ -458,7 +433,7 @@ function event_exercice($exo_id, $score, $weighting)
{
$user_id = "NULL";
}
$sql = "INSERT INTO ".$TABLETRACK_EXERCICES."
$sql = "INSERT INTO $TABLETRACK_EXERCICES
(
exe_user_id,
exe_cours_id,
@ -477,21 +452,8 @@ function event_exercice($exo_id, $score, $weighting)
'".$weighting."',
FROM_UNIXTIME(".$reallyNow.")
)";
/* SEE WHAT WE DO WITH THAT
$tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
if ($origin == 'learnpath')
{
if ($user_id == "NULL")
{
$user_id = '0';
}
$sql2 = "update $tbl_learnpath_user set score='$score' where (user_id=$user_id and learnpath_id='$learnpath_id' and learnpath_item_id='$learnpath_item_id')";
$res2 = api_sql_query($sql2,__FILE__,__LINE__);
}
*/
$res = api_sql_query($sql,__FILE__,__LINE__);
//$mysql_query($sql);
//return 0;
$res = @api_sql_query($sql,__FILE__,__LINE__);
return $res;
}
/**
@ -501,14 +463,12 @@ function event_exercice($exo_id, $score, $weighting)
* @param integer Question ID
* @param integer Exercise ID
* @param integer Position
* @return boolean Result of the insert query
*/
function exercise_attempt($score,$answer,$quesId,$exeId,$j)
{
global $_configuration;
global $_user;
global $_cid;
global $TBL_TRACK_ATTEMPT;
global $origin, $learnpath_id, $learnpath_item_id;
global $_configuration, $_user, $_cid;
$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
// if tracking is disabled record nothing
if (!$_configuration['tracking_enabled'])
@ -522,20 +482,20 @@ function exercise_attempt($score,$answer,$quesId,$exeId,$j)
$user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
{
$user_id = "NULL";
}
$sql = "INSERT INTO ".$TBL_TRACK_ATTEMPT."
(exe_id,
}
$sql = "INSERT INTO $TBL_TRACK_ATTEMPT
(
exe_id,
user_id,
question_id,
answer,
marks,
course_code,
position
position,
tms
)
VALUES
(
".$exeId.",
@ -544,24 +504,11 @@ function exercise_attempt($score,$answer,$quesId,$exeId,$j)
'".addslashes($answer)."',
'".$score."',
'".$_cid."',
'".$j."'
)";
/* SEE WHAT WE DO WITH THAT
$tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
if ($origin == 'learnpath')
{
if ($user_id == "NULL")
{
$user_id = '0';
}
$sql2 = "update $tbl_learnpath_user set score='$score' where (user_id=$user_id and learnpath_id='$learnpath_id' and learnpath_item_id='$learnpath_item_id')";
$res2 = api_sql_query($sql2,__FILE__,__LINE__);
}
*/
//$res = api_sql_query($sql,__FILE__,__LINE__);
$res = mysql_query($sql) or die(mysql_error());
//return 0;
'".$j."',
FROM_UNIXTIME(".$reallyNow.")
)";
$res = @api_sql_query($sql,__FILE__,__LINE__);
return $res;
}
/**

@ -112,7 +112,8 @@ CREATE TABLE track_e_attempt (
teacher_comment text NOT NULL,
marks int NOT NULL default 0,
course_code varchar(40) NOT NULL default '',
position int default 0
position int default 0,
tms datetime NOT NULL default '0000-00-00 00:00:00'
);
ALTER TABLE track_e_attempt ADD INDEX (exe_id);
ALTER TABLE track_e_attempt ADD INDEX (user_id);

@ -77,6 +77,7 @@ ALTER TABLE track_e_links ADD INDEX (links_cours_id);
ALTER TABLE track_e_links ADD INDEX (links_user_id);
ALTER TABLE track_e_uploads ADD INDEX (upload_user_id);
ALTER TABLE track_e_uploads ADD INDEX (upload_cours_id);
ALTER TABLE track_e_attempt ADD tms datetime not null default '0000-00-00 00:00:00';
-- xxUSERxx

@ -1,27 +1,5 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2007 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
<?php // $Id: update-db-1.8.4-1.8.5.inc.php 14543 2008-03-09 17:32:54Z yannoo $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
* Update the Dokeos database from an older version

@ -1,26 +1,5 @@
<?php //$Id: update-files-1.8.4-1.8.5.inc.php 13601 2007-10-30 06:20:17Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2007 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
<?php //$Id: update-files-1.8.4-1.8.5.inc.php 14543 2008-03-09 17:32:54Z yannoo $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
* Updates the Dokeos files from version 1.8.3 to version 1.8.4

Loading…
Cancel
Save