Skip to content

Commit

Permalink
Added content to item and sharedpassage
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsharman committed Aug 28, 2017
1 parent c453ce6 commit 263a17c
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 18 deletions.
12 changes: 8 additions & 4 deletions src/Config/resources/schemas/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"type": "string",
"description": "A unique item identifier across Itembank. It has a limitation of maximum of 150 characters and must only contain ASCII printable characters, except for double quotes, single quotes and accent."
},
"definition": {
"required": true,
"type": "object",
"description": "An object defining the layout of the item wrapper."
"content": {
"required": false,
"type": "string",
"description": ""
},
"questionReferences": {
"required": false,
"type": "array"
},
"questions": {
"required": false,
Expand Down
6 changes: 6 additions & 0 deletions src/Config/resources/schemas/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -29307,6 +29307,12 @@
"required": false,
"description": "It will be displayed above the sharedpassage's heading.",
"type": "string"
},
"content": {
"name": "Content",
"required": false,
"description": "Manually entered into Schemas because entity generator doesn't support conditionals today...",
"type": "string"
}
},
"type": "feature",
Expand Down
45 changes: 31 additions & 14 deletions src/Entities/Item/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
*/
class item extends BaseEntity {
protected $reference;
protected $definition;
protected $content;
protected $questionReferences;
protected $questions;
protected $features;
protected $metadata;
Expand All @@ -19,12 +20,10 @@ class item extends BaseEntity {
protected $workflow;

public function __construct(
$reference,
$definition
$reference
)
{
$this->reference = $reference;
$this->definition = $definition;
}

/**
Expand All @@ -48,21 +47,39 @@ public function set_reference ($reference) {
}

/**
* Get definition \
* An object defining the layout of the item wrapper. \
* @return object $definition \
* Get content \
* \
* @return string $content \
*/
public function get_content() {
return $this->content;
}

/**
* Set content \
* \
* @param string $content \
*/
public function get_definition() {
return $this->definition;
public function set_content ($content) {
$this->content = $content;
}

/**
* Set definition \
* An object defining the layout of the item wrapper. \
* @param object $definition \
* Get questionReferences \
* \
* @return array $questionReferences \
*/
public function get_questionReferences() {
return $this->questionReferences;
}

/**
* Set questionReferences \
* \
* @param array $questionReferences \
*/
public function set_definition ($definition) {
$this->definition = $definition;
public function set_questionReferences (array $questionReferences) {
$this->questionReferences = $questionReferences;
}

/**
Expand Down
19 changes: 19 additions & 0 deletions src/Entities/QuestionTypes/sharedpassage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class sharedpassage extends BaseQuestionType {
protected $paginated_content;
protected $is_math;
protected $instructor_stimulus;
protected $content;

public function __construct(
$type
Expand Down Expand Up @@ -131,6 +132,24 @@ public function set_instructor_stimulus ($instructor_stimulus) {
$this->instructor_stimulus = $instructor_stimulus;
}

/**
* Get Content \
* Manually entered into Schemas because entity generator doesn't support conditionals today... \
* @return string $content \
*/
public function get_content() {
return $this->content;
}

/**
* Set Content \
* Manually entered into Schemas because entity generator doesn't support conditionals today... \
* @param string $content \
*/
public function set_content ($content) {
$this->content = $content;
}


public function get_widget_type() {
return 'feature';
Expand Down

0 comments on commit 263a17c

Please sign in to comment.