You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
995 B
48 lines
995 B
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
require_once 'Resource.class.php';
|
|
|
|
/**
|
|
* An Quiz
|
|
* Exercises backup script
|
|
* @author Bart Mollet <bart.mollet@hogent.be>
|
|
* @package chamilo.backup
|
|
*/
|
|
class Quiz extends Coursecopy\Resource
|
|
{
|
|
/**
|
|
* Create a new Quiz
|
|
* @param string $title
|
|
* @param string $description
|
|
* @param int $random
|
|
* @param int $type
|
|
* @param int $active
|
|
*/
|
|
public $obj; //question
|
|
|
|
public function __construct($obj)
|
|
{
|
|
$this->obj = $obj;
|
|
$this->obj->quiz_type = $this->obj->type;
|
|
parent::__construct($obj->id, RESOURCE_QUIZ);
|
|
}
|
|
|
|
/**
|
|
* Add a question to this Quiz
|
|
*/
|
|
public function add_question($id, $question_order)
|
|
{
|
|
$this->obj->question_ids[] = $id;
|
|
$this->obj->question_orders[] = $question_order;
|
|
}
|
|
|
|
/**
|
|
* Show this question
|
|
*/
|
|
public function show()
|
|
{
|
|
parent::show();
|
|
echo $this->obj->title;
|
|
}
|
|
}
|
|
|