You are here

private function DragDropQuestion::getSubquestions in Quiz Drag Drop 7

Helper function to fetch subquestions.

Return value

array Array with two arrays, matches and selected options

1 call to DragDropQuestion::getSubquestions()
DragDropQuestion::getAnsweringForm in ./quiz_drag_drop.classes.inc
Generates the question form.

File

./quiz_drag_drop.classes.inc, line 197
Question type, enabling the creation of drag drop type of questions.

Class

DragDropQuestion
Extension of QuizQuestion.

Code

private function getSubquestions() {
  $title = $image = array();
  $node_detail = node_load($this->node->nid);
  foreach ($node_detail->field_dragdrop_image[LANGUAGE_NONE] as $key => $val) {
    $style = 'thumbnail';
    $path = $val['uri'];
    $fid = $val['fid'];
    $data = array(
      'style_name' => $style,
      'path' => $path,
      'fid' => $fid,
    );
    $title[] = array(
      'fid' => $val['fid'],
      'title' => $val['title'],
      'uri' => $this
        ->imageStyle($data),
    );
    $image[] = array(
      'fid' => $val['fid'],
      'title' => $val['title'],
      'uri' => $this
        ->imageStyle($data),
    );
  }
  return array(
    $title,
    $image,
  );
}