marcusgreen / moodle-qtype_category

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question type template

A clone of Jamie Pratts Question type template

Except with more features (or at least more template features)

A simple question type template.

It is a copy of the shortanswer question type with everything unnecessary removed and :

  • countback grading
  • hints
  • question text
  • no input controls at all in question as yet
  • it doesn't install any new tables

Additional features by comparisons with Jamies version

  • db folder and files
  • backup template code
  • xml import/export code
  • mobile app support

Additional advice can be found here

https://github.com/marcusgreen/moodle-qtype_TEMPLATE/wiki

Who should use

This is one alternative start for devloping a question type plug in and is working code as is. Although it doesn't do any actual grading or collect student input at all.

Depending on what type of question plug in you want to develope it might be good to either :

  • use one of the existing question types that is doing something similar to what you want to do as a base, copy that, have fun deleting no longer needed code and you then have a template to start from.
  • or if possible to avoid code duplication it is better to extend existing classes, particularly for the question type and question classes. There are quite a few examples of queston types that do this at https://github.com/moodleou/. for example classes in ddimageortext and ddmarker both inherit from common code in ddimageortext and those inherit code from the gapselect question type
  • or this code might help start you off.

Installation

Installation Using Git

To install using git for the latest version (the master branch), type this command in the root of your Moodle install:

git clone git://github.com/marcusgreen/moodle-qtype_TEMPLATE.git question/type/TEMPLATE
echo '/question/type/TEMPLATE' >> .git/info/exclude

Installation From Downloaded zip file

Alternatively, download the zip from :

unzip it into the question/type folder, and then rename the new folder to TEMPLATE.

Doesn't get installed as long as it is called TEMPLATE

You can keep a copy of the template in Moodle in the question/type/ folder and as long as it is called TEMPLATE the plug in will be ignored.

Use

  • Copy or rename the module directory to category.
  • Replace all occurances of category in files with the new name for your question type.
  • Rename files that have category replacing category with the new name for your question type.
  • Replace '@copyright THEYEAR YOURNAME (YOURCONTACTINFO)' with something like @copyright 2016 Marcus Green (mgreen@example.org)
  • See http://docs.moodle.org/dev/Question_types for more info on how to create a question type plug in. Please add to it where you can.

About


Languages

Language:PHP 82.8%Language:JavaScript 15.7%Language:HTML 1.4%Language:CSS 0.1%