Skip to content

Commit

Permalink
minor changes in quiz-builder option
Browse files Browse the repository at this point in the history
  • Loading branch information
themefuse committed Dec 22, 2014
1 parent f5bc0a0 commit 9392fab
Showing 1 changed file with 29 additions and 51 deletions.
80 changes: 29 additions & 51 deletions extensions/learning-quiz/class-fw-extension-learning-quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,35 +254,38 @@ public function _filter_admin_lessons_quiz_option( $options, $post_type ) {
return $options;
}

if ( isset( $options['main'] ) && $options['main']['type'] == 'box' ) {
$options['main']['options'][ $this->get_name() ] = array(
'title' => __( 'Lesson Quiz', 'fw' ),
$tab_options = array(
'quiz-tab' => array(
'title' => __( 'Quiz Elements', 'fw' ),
'type' => 'tab',
'options' => array(
'quiz-tab' => array(
'title' => __( 'Quiz Elements', 'fw' ),
'type' => 'tab',
'options' => array(
$this->get_name() . '-questions' => array(
'label' => false,
'type' => 'quiz-builder',
'fullscreen' => false,
'template_saving' => false,
),
)
$this->get_name() . '-questions' => array(
'label' => false,
'type' => 'quiz-builder',
'fullscreen' => false,
'template_saving' => false,
'history' => true,
),
'pass-tab' => array(
'title' => __( 'Quiz settings', 'fw' ),
'type' => 'tab',
'options' => array(
$this->get_name() . '-passmark' => array(
'label' => __( 'Quiz Passmark Percentage', 'fw' ),
'type' => 'text',
'desc' => __( 'The percentage at which the test will be passed.', 'fw' ),
),
)
)
)
),
'pass-tab' => array(
'title' => __( 'Quiz settings', 'fw' ),
'type' => 'tab',
'options' => array(
$this->get_name() . '-passmark' => array(
'label' => __( 'Quiz Passmark Percentage', 'fw' ),
'type' => 'text',
'desc' => __( 'The percentage at which the test will be passed.', 'fw' ),
),
)
)
);

if ( isset( $options['main'] ) && $options['main']['type'] == 'box' ) {
$options['main']['options'][ $this->get_name() ] = array(
'title' => __( 'Lesson Quiz', 'fw' ),
'type' => 'tab',
'options' => $tab_options
);
} else {
$options['main'] = array(
Expand All @@ -292,32 +295,7 @@ public function _filter_admin_lessons_quiz_option( $options, $post_type ) {
'lesson-quiz-tab' => array(
'title' => __( 'Lesson Quiz', 'fw' ),
'type' => 'tab',
'options' => array(
'quiz-tab' => array(
'title' => __( 'Quiz Elements', 'fw' ),
'type' => 'tab',
'options' => array(
$this->get_name() . '-questions' => array(
'label' => false,
'type' => 'quiz-builder',
'fullscreen' => false,
'template_saving' => false,
'editor_integration' => true
),
)
),
'pass-tab' => array(
'title' => __( 'Quiz settings', 'fw' ),
'type' => 'tab',
'options' => array(
$this->get_name() . '-passmark' => array(
'label' => __( 'Quiz Passmark Percentage', 'fw' ),
'type' => 'text',
'desc' => __( 'The percentage at which the test will be passed.', 'fw' ),
),
)
)
)
'options' => $tab_options
)
)
);
Expand Down

0 comments on commit 9392fab

Please sign in to comment.