Minor - Improve scorm classes adding declaration of attributes that were otherwise defined dynamically

pull/2487/head
Yannick Warnier 9 years ago
parent 40cf01eb2a
commit 6df32bedee
  1. 2
      main/exercise/answer.class.php
  2. 9
      main/exercise/export/scorm/scorm_classes.php

@ -37,6 +37,8 @@ class Answer
public $new_destination; // id of the next question if feedback option is set to Directfeedback
public $course; //Course information
public $iid;
public $questionJSId;
public $standalone;
/**
* constructor of the class

@ -18,6 +18,8 @@
*/
class ScormQuestion extends Question
{
public $js_id;
public $answer;
/**
* Returns the HTML + JS flow corresponding to one question
*
@ -27,6 +29,7 @@ class ScormQuestion extends Question
* Due to the nature of interactions, we must have a natural sequence for
* questions in the generated JavaScript.
* @param integer $js_id
* @return string|array
*/
public static function export_question($questionId, $standalone = true, $js_id)
{
@ -378,7 +381,6 @@ class ScormAnswerFillInBlanks extends Answer
foreach ($this->answer as $i => $answer) {
$blankList[] = '['.$answer.']';
}
$answerCount = count($blankList);
// splits text and weightings that are joined with the character '::'
list($answer,$weight)=explode('::',$answer);
@ -881,11 +883,8 @@ class ScormAssessmentItem
/**
* Export the question as a SCORM Item.
*
* This is a default behaviour, some classes may want to override this.
*
* @param $standalone: Boolean stating if it should be exported as a stand-alone question
* @return A string, the XML flow for an Item.
* @return string|array A string, the XML flow for an Item.
*/
function export()
{

Loading…
Cancel
Save