Julio Montoya 15 years ago
parent
commit
05e2b3a682

+ 11 - 22
documentation/readme.html

@@ -35,32 +35,32 @@
       through groups, forums, chat.</p>
 
 
-<p>Technically, Dokeos is a web application written in PHP that stores data in a <br />
+<p>Technically, Chamilo is a web application written in PHP that stores data in a <br />
 
       MySQL database. Users access it using a web browser.</p>
 
 
 <p>If you would like to know more or help develop this software, please visit<br />
 
-      our homepage at <a href="http://www.dokeos.com">http://www.dokeos.com</a></p>
+      our homepage at <a href="http://www.chamilo.org">http://www.chamilo.org</a></p>
 
 
 <h1>SCORM</h1>
 
-    Dokeos FREE imports Scorm 1.2 contents.<br />
+    Chamilo FREE imports Scorm 1.2 contents.<br />
 
     For more information on Scorm normalisation, see http://www.adlnet.org<br />
 
 <h1>Licence</h1>
 
-<p>Dokeos is distributed under the GNU General Public license (GPL).<br />
+<p>Chamilo is distributed under the GNU General Public license (GPL).<br />
 
       Read the <a href="licence.html">GNU General Public license (GPL)</a> .</p>
 
 
 <h1>Portability</h1>
 
-<p>Dokeos is an AMP software. This means it should work on any platform running Apache<br />
+<p>Chamilo is an AMP software. This means it should work on any platform running Apache<br />
 
       + MySQL + PHP. It is then supposed to work on the following Operating Systems :</p>
 
@@ -98,7 +98,7 @@
 
 <h1>Interoperability</h1>
 
-<p>Dokeos imports Scorm compliant learning contents. It imports then "On the shelve"<br />
+<p>Chamilo imports Scorm compliant learning contents. It imports then "On the shelve"<br />
 
       contents from many companies : NETg, Skillsoft, Explio, Microsoft, Macromedia, etc.</p>
 
@@ -110,32 +110,21 @@
 
       export to CSV and/or XML.</p>
 
-<p>Dokeos includes a LDAP module that allows admin to deactivate MySQL authentication<br />
+<p>Chamilo includes a LDAP module that allows admin to deactivate MySQL authentication<br />
 
       and replace it by connection to a LDAP directory.</p>
 
-<p>Client side, Dokeos runs on any browser : Firefox, MS Internet Explorer (5.0+), Netscape (4.7+),<br />
+<p>Client side, Chamilo runs on any browser : Firefox, MS Internet Explorer (5.0+), Netscape (4.7+),<br />
 
       Mozilla (1.2+), Safari, Opera, ...</p>
 
 <h1>Chamilo.org</h1>
 
-<p>Chamilo is also a consulting company helping companies in their e-learning projects and selling Dokeos PRO and Dokeos MEDICAL.<br />
-
+<p>Chamilo is also a consulting company helping companies in their e-learning projects and selling Chamilo PRO and Chamilo MEDICAL.<br />
       <br />
-
-      You can find more information on our services on <a href="http://www.dokeos.com/en/node/61">http://www.dokeos.com/en/node/61</a><a href="http://www.dokeos.com/services.php"></a></p>
-
-<p>
+ <p>
 <em>Contact address</em>: <br />
-
-      Dokeos<br />Rue Victor Hugo, 201<br />
-
-      B-1030 Brussels - Belgium<br />
-
-      Tel. +32 (2) 669 69 55<br />
-
-      Mail: <a href="mailto:info@dokeos.com">info@dokeos.com</a>
+      Mail: <a href="mailto:info@chamilo.org">info@chamilo.org</a>
 </p>
 
 </div>

+ 1 - 1
main/exercice/answer.class.php

@@ -333,7 +333,7 @@ class Answer
 	 function getQuestionType()
 	 {
 	 	$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
-	 	$sql = "SELECT * FROM $TBL_QUESTIONS WHERE id = '".Database::escape_string($this->questionId)."'";
+	 	$sql = "SELECT type FROM $TBL_QUESTIONS WHERE id = '".Database::escape_string($this->questionId)."'";
 	 	$res = Database::query($sql,__FILE__,__LINE__);
 	 	if(Database::num_rows($res)<=0){
 	 		return null;

+ 1 - 4
main/exercice/exercise_show.php

@@ -119,10 +119,7 @@ if (isset($_SESSION['gradebook'])){
 }
 
 if (!empty($gradebook) && $gradebook=='view') {
-	$interbreadcrumb[]= array (
-			'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
-			'name' => get_lang('Gradebook')
-		);
+	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('Gradebook'));
 }
 $fromlink = '';
 if($origin=='user_course') {

+ 36 - 6
main/exercice/export/scorm/scorm_classes.php

@@ -82,6 +82,10 @@ class ScormQuestion extends Question
 				break;
 			case HOTSPOT:
 				$this->answer = new ScormAnswerHotspot($this->id);
+                $this->answer->questionJSId = $this->js_id;
+				break;
+			case MULTIPLE_ANSWER_COMBINATION:
+				$this->answer = new ScormAnswerMultipleChoice($this->id, false);
                 $this->answer->questionJSId = $this->js_id;
 				break;
 			default :
@@ -170,8 +174,10 @@ class ScormAnswerMultipleChoice extends Answer
 		$type = $this->getQuestionType();
 		$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
 		$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
-        if ($type == MCMA)
-        {
+		
+		//not sure if we are going to export also the MULTIPLE_ANSWER_COMBINATION to SCORM
+        //if ($type == MCMA  || $type == MULTIPLE_ANSWER_COMBINATION ) {
+		if ($type == MCMA ) {
         	//$questionTypeLang = get_lang('MultipleChoiceMultipleAnswers');
         	$id = 1;
         	$jstmp = '';
@@ -198,11 +204,35 @@ class ScormAnswerMultipleChoice extends Answer
 			}
 			$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');'."\n";
 	    	$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.substr($jstmpc,0,-1).');'."\n";
-	    	$js .= 'questions_types['.$this->questionJSId.'] = \'mcma\';'."\n";
+	    	if ($type == MCMA) {
+	    		$js .= 'questions_types['.$this->questionJSId.'] = \'mcma\';'."\n";
+	    	} else {
+	    		$js .= 'questions_types['.$this->questionJSId.'] = \'exact\';'."\n";
+	    	}	    	
 	    	$js .= $jstmpw;
-        }
-        else
-        {
+        } elseif ($type == MULTIPLE_ANSWER_COMBINATION) {
+        		//To this items we show the ThisItemIsNotExportable
+        	    $qId = $this->questionJSId;
+		    	$js = '';
+		    	$html = '<tr><td colspan="2"><table width="100%">' . "\n";
+				// some javascript must be added for that kind of questions
+				$html .= '<tr>' . "\n"
+						.	'<td>' . "\n"
+				    	. '<textarea name="question_'.$qId.'_free" id="question_'.$qId.'_free" rows="20" cols="100"></textarea>' . "\n"
+				    	.	'</td>' . "\n"
+				    	.	'</tr>' . "\n";
+				$html .= '</table></td></tr>' . "\n";
+				// currently the free answers cannot be displayed, so ignore the textarea
+				$html = '<tr><td colspan="2">'.get_lang('ThisItemIsNotExportable').'</td></tr>';
+				$js .= 'questions_answers['.$this->questionJSId.'] = new Array();'."\n";
+		    	$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array();'."\n";
+		    	$js .= 'questions_types['.$this->questionJSId.'] = \'free\';'."\n";
+				$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
+				$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
+		    	$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][1] = 0;'.";\n";
+		    	$js .= $jstmpw;
+		        return array($js,$html);
+        } else {
         	//$questionTypeLang = get_lang('MultipleChoiceUniqueAnswer');
         	$id = 1;
         	$jstmp = '';

+ 1 - 2
main/exercice/export/scorm/scorm_export.php

@@ -612,8 +612,7 @@ class ScormSection
 function export_exercise($exerciseId, $standalone=true)
 {
     $exercise = new Exercise();
-    if (! $exercise->read($exerciseId))
-    {
+    if (! $exercise->read($exerciseId)) {
         return '';
     }
     $ims = new ScormSection($exercise);

+ 12 - 3
main/inc/lib/main_api.lib.php

@@ -4188,11 +4188,20 @@ function api_get_tool_information($tool_id) {
 	$sql = 'SELECT * FROM '.$t_tool.' WHERE id="'.Database::escape_string($tool_id).'"';
 	$rs  = Database::query($sql, __FILE__, __LINE__);
 	return Database::fetch_array($rs);
-}
+} 
 
+/**
+ * Gets the software name
+ * @param string 
+ * 
+ */
 function api_get_software_name() {
-	global $_configuration;
-	return $_configuration['software_name'];
+	global $_configuration;	
+	if (isset($_configuration['software_name']) && !empty($_configuration['software_name'])) {
+		return $_configuration['software_name'];
+	} else {
+		return 'Chamilo';
+	}
 }
 
 /*

+ 46 - 0
main/newscorm/js/api_wrapper.js

@@ -629,6 +629,52 @@ function checkAnswers(interrupted)
 				//{
 				//	interactionCorrectResponses += questions_answers_correct[idQuestion][k].toString()+',';
 				//}
+			} else if(type == 'exact') {
+				// not yet implemented see scorm_classes.php ScormAnswerMultipleChoice::export() function 
+				/*
+				var interactionType = 'exact';
+				var myScore = 0;
+				var real_answers = new Array();
+
+				for(var j=0; j<questions_answers[idQuestion].length;j++) {
+					var idAnswer = questions_answers[idQuestion][j];
+					var answer   = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer));
+					if (answer.checked == true) {
+						if(questions_answers_ponderation[idQuestion][idAnswer] != 0 ) {
+							real_answers[j] = true;
+						} else {
+							real_answers[j] = false;
+						}
+					} else {
+						if(questions_answers_ponderation[idQuestion][idAnswer] != 0) {
+							real_answers[j] = false;
+						} else {
+							real_answers[j] = true;
+						}
+					}
+					//alert(real_answers[j] +' ' + answer.checked + ' ' + questions_answers_ponderation[idQuestion][idAnswer]);
+				}
+
+				var final_answer = true;
+				for(var z=0; z<real_answers.length ;z++) {		
+		 			if (real_answers[z] == false) {
+			 			final_answer = false;
+			 		}		 	
+			 	}
+
+			 	if (final_answer == true) {
+			 		//getting only the first score where we save the weight of all the question 
+					myScore += questions_answers_ponderation[idQuestion][1];
+				}
+			
+				interactionScore = myScore;
+				//correct responses work by pattern, see SCORM Runtime Env Doc
+				//for(k=0;k<questions_answers_correct[idQuestion].length;k++)
+				//{
+				//	interactionCorrectResponses += questions_answers_correct[idQuestion][k].toString()+',';
+				//}
+				scoreMax += questions_score_max[idQuestion];
+				*/
 			}
 			else
 			{