Download & Extend

Quiz File Upload

File upload quiz

Quiz file upload module provides a new content type to use with quiz module as a question type. It allows users to upload file as a response to quiz question.

Features

  • Users can upload predefined file extensions as a response to quiz question.
  • Allowed file extensions can be defined globally and overridden per question.
  • Can preserve attached file along Back / Next navigation.
  • Can accept only one file input per question.
  • Rudimentary scoring option. Sets globally defined integer value as score to response on file upload.
  • No manual scoring as in long answer and short answer. (I do welcome patches for this feature)
  • Serves good for survey / personality kind of quizzes.

Credit

This module was developed by Sivaji at KnackForge - The Drupal shop based out of Chennai, India. We offer Drupal development, consultancy, hosting and support to customers worldwide. Sponsored by LogicMedia (jesse at logicmedia dot be)

Installation

Download the recommended version from project page, place the module code in folder /sites/all/modules/quiz/question_types/ and enable it from module manager page /admin/build/modules.

Patch

This module needs the below patch to quiz_question.module.

diff --git a/question_types/quiz_question/quiz_question.module b/question_types/
index 540429d..30219a9 100644
--- a/question_types/quiz_question/quiz_question.module
+++ b/question_types/quiz_question/quiz_question.module
@@ -255,6 +255,9 @@ function quiz_question_evaluate_question($question, $result_
     // FIXME this use of POST array is hacky. We will try to use FAPI mor accur
     $answer = $_POST['tries'];
   }
+  if (empty($answer) && isset($_FILES['files']['type']['tries']) && !empty($_FILES['files']['type']['tries'])) {
+    $answer = $_FILES;  
+  }
   unset($_POST['tries']);
   $response = _quiz_question_response_get_instance($result_id, $question, $answ

@@ -861,4 +864,4 @@ function quiz_question_report_form($question, $showpoints, $
   }

After the patch the function quiz_question_evaluate_question() definition would look as in drupalbin http://drupalbin.com/18963

How to use

Installing this module would show-up a new question type in quiz, Manage questions tab, under Create new question fieldset. Otherwise it follows the same flow as other question types.

Configuration

This module can work without any initial configuration, if you prefer to change the allowed file extensions, follow the instructions below,

  • Navigate to Administer › Quiz management › Quiz settings or drupal path admin/quiz/settings/questions_settings.
  • Set the default allowed extensions and score (this module does nothing great in regards to score).

Downloads

Version Downloads Date Links
6.x-1.1 tar.gz (9.48 KB) | zip (10.65 KB) 2011-Jun-25 Notes

Project Information


Maintainers for Quiz File Upload

  • sivaji - 3 commits
    last: 47 weeks ago, first: 48 weeks ago

Issues for Quiz File Upload

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here