Bladeren bron

[svn r10749] http://www.dokeos.com/forum/viewtopic.php?t=8256

Patrick Cool 18 jaren geleden
bovenliggende
commit
e1d5c20f62
2 gewijzigde bestanden met toevoegingen van 25 en 12 verwijderingen
  1. 13 7
      main/exercice/exercise_show.php
  2. 12 5
      main/exercice/mark_free_answer.php

+ 13 - 7
main/exercice/exercise_show.php

@@ -4,9 +4,17 @@
  * @todo use the Database:: functions
  * @todo small letters for table variables
  */
-include('exercise.class.php');
-include('question.class.php');
-include('answer.class.php');
+// name of the language file that needs to be included 
+$language_file='exercice';
+
+// including the global dokeos file
+include('../inc/global.inc.php');
+
+// including additional libraries
+include_once('exercise.class.php');
+include_once('question.class.php');
+include_once('answer.class.php');
+include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
 
 // answer types
 define('UNIQUE_ANSWER',	1);
@@ -16,14 +24,12 @@ define('MATCHING',		4);
 define('FREE_ANSWER', 5);
 define('HOTSPOT', 6);
 
-// name of the language file that needs to be included 
-$language_file='exercice';
 
-include('../inc/global.inc.php');
+
 
 $this_section=SECTION_COURSES;
 api_protect_course_script();
-include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
+
 
 // Database table definitions
 $TBL_EXERCICE_QUESTION 	= $_course['dbNameGlu'].'quiz_rel_question';

+ 12 - 5
main/exercice/mark_free_answer.php

@@ -24,8 +24,11 @@
 *	FREE ANSWER MARKING SCRIPT  
 *
 *	This script allows a course tutor to mark a student's free answer.
-*@author Yannick Warnier <yannick.warnier@dokeos.com>
+*	@author Yannick Warnier <yannick.warnier@dokeos.com>
 *	@package dokeos.exercise
+* 
+* 	@todo use the Database:: functions
+* 	@todo respect coding guidelines
 ============================================================================== 
 */
 
@@ -34,10 +37,17 @@
 		INIT SECTION
 ==============================================================================
 */
+// name of the language file that needs to be included 
+$language_file='exercice';
+
+// name of the language file that needs to be included 
+include('../inc/global.inc.php');
 
+// including additional libraries
 include('exercise.class.php');
 include('question.class.php');
 include('answer.class.php');
+include_once(api_get_library_path().'/text.lib.php');
 
 // answer types
 define('UNIQUE_ANSWER',	1);
@@ -46,13 +56,10 @@ define('FILL_IN_BLANKS',	3);
 define('MATCHING',		4);
 define('FREE_ANSWER', 5);
 
-// name of the language file that needs to be included 
-$language_file='exercice';
 
-include('../inc/global.inc.php');
 
-include(api_get_library_path().'/text.lib.php');
 
+/** @todo use the Database:: functions */
 $TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
 $TBL_EXERCICES         = $_course['dbNameGlu'].'quiz';
 $TBL_QUESTIONS         = $_course['dbNameGlu'].'quiz_question';