summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaelk2012-12-15 12:26:26 (GMT)
committer Sivaji2012-12-15 12:26:26 (GMT)
commitfdb20b9430c0c2d78ea70a07de3000b10640d795 (patch)
tree378f769b311cf50aa732b6c93df0c929a7535f18
parent578a0fbeb0fa17708b76726ccf22b55f64daa5c5 (diff)
Refs #1865246 - Make all question type fields reorderable through the Manage Fields content type page
-rw-r--r--question_types/long_answer/long_answer.module16
-rw-r--r--question_types/matching/matching.module16
-rw-r--r--question_types/short_answer/short_answer.module16
-rw-r--r--question_types/truefalse/truefalse.module21
4 files changed, 69 insertions, 0 deletions
diff --git a/question_types/long_answer/long_answer.module b/question_types/long_answer/long_answer.module
index a3d058b..b0f77a6 100644
--- a/question_types/long_answer/long_answer.module
+++ b/question_types/long_answer/long_answer.module
@@ -291,3 +291,19 @@ function long_answer_report_validate($values, $form_key) {
form_set_error($form_key . '][score', t('The score needs to be a number between @min and @max', array('@min' => 0, '@max' => $max)));
}
}
+
+/**
+ * Implements hook_field_extra_fields().
+ */
+function long_answer_field_extra_fields() {
+ $extra['node']['long_answer'] = array(
+ 'form' => array(
+ 'rubric' => array(
+ 'label' => t('Rubric'),
+ 'description' => t('Specify the criteria for grading the response'),
+ 'weight' => -4,
+ ),
+ ),
+ );
+ return $extra;
+}
diff --git a/question_types/matching/matching.module b/question_types/matching/matching.module
index 1f55f6b..cb1ce76 100644
--- a/question_types/matching/matching.module
+++ b/question_types/matching/matching.module
@@ -102,3 +102,19 @@ function matching_theme() {
);
}
+
+/**
+ * Implements hook_field_extra_fields().
+ */
+function matching_field_extra_fields() {
+ $extra['node']['matching'] = array(
+ 'form' => array(
+ 'match' => array(
+ 'label' => t('Answer'),
+ 'description' => t('The sets of matches for this question.'),
+ 'weight' => -4,
+ ),
+ ),
+ );
+ return $extra;
+}
diff --git a/question_types/short_answer/short_answer.module b/question_types/short_answer/short_answer.module
index c528ad7..4083310 100644
--- a/question_types/short_answer/short_answer.module
+++ b/question_types/short_answer/short_answer.module
@@ -227,3 +227,19 @@ function short_answer_get_answer($question_nid, $question_vid, $result_id) {
WHERE sa.question_nid = :qnid AND sa.question_vid = :qvid AND sa.result_id = :rid', array(':qnid' => $question_nid, ':qvid' => $question_vid, ':rid' => $result_id))->fetchAssoc();
return $results ? $results : FALSE;
}
+
+/**
+ * Implements hook_field_extra_fields().
+ */
+function short_answer_field_extra_fields() {
+ $extra['node']['short_answer'] = array(
+ 'form' => array(
+ 'answer' => array(
+ 'label' => t('Answer'),
+ 'description' => t('Provide the answer and the method by which the answer will be evaluated.'),
+ 'weight' => -4,
+ ),
+ ),
+ );
+ return $extra;
+}
diff --git a/question_types/truefalse/truefalse.module b/question_types/truefalse/truefalse.module
index dacacb0..c7abcda 100644
--- a/question_types/truefalse/truefalse.module
+++ b/question_types/truefalse/truefalse.module
@@ -77,3 +77,24 @@ function theme_truefalse_response($variables) {
$data = $variables['data'];
return theme('table', array('header' => $metadata, 'rows' => $data));
}
+
+/**
+ * Implements hook_field_extra_fields().
+ */
+function truefalse_field_extra_fields() {
+ $extra['node']['truefalse'] = array(
+ 'form' => array(
+ 'correct_answer' => array(
+ 'label' => t('Correct answer'),
+ 'description' => t('The answer for this question.'),
+ 'weight' => -4,
+ ),
+ 'feedback_fields' => array(
+ 'label' => t('Feedback Settings'),
+ 'description' => t('Settings pertaining to feedback given along with results.'),
+ 'weight' => -4,
+ ),
+ ),
+ );
+ return $extra;
+}