.. image:: https://coveralls.io/repos/github/cjlee112/socraticqs2/badge.svg?branch=master :target: https://coveralls.io/github/cjlee112/socraticqs2?branch=master
.. image:: https://codecov.io/gh/cjlee112/socraticqs2/branch/master/graph/badge.svg :target: https://codecov.io/gh/cjlee112/socraticqs2
.. image:: https://circleci.com/gh/raccoongang/socraticqs2/tree/development.svg?style=svg :target: https://circleci.com/gh/raccoongang/socraticqs2/tree/development
Socraticqs2 is the web engine for courselets.org.
To run project locally ::
make run
To develop/debug project locally ::
make debug
To build project locally ::
make build
To run tests: ::
make test
To stop containers: ::
make stop
To clean/rm containers: ::
make rm
To run production/staging environment locally: ::
make run env=stage
To build production/staging environment locally: ::
make build env=stage
Build node packages locally: ::
make local_node
CI/CD configuration is described by .gitlab-ci.yml
_ file.
.. _.gitlab-ci.yml: ./.gitlab-ci.yml
Current deployment scheme is the following:
There is a helper that creates a tag for you: ::
make version VERSION=vX.X.X
Developer documentation is available at http://cjlee112.github.io/socraticqs2
For a developer / test version to access social-auth, you will need to add the following social-auth keys to settings/local_conf.py in your development install: ::
# coding: utf-8
SOCIAL_AUTH_TWITTER_KEY = 'key'
SOCIAL_AUTH_TWITTER_SECRET = 'secret'
SOCIAL_AUTH_FACEBOOK_KEY = 'key'
SOCIAL_AUTH_FACEBOOK_SECRET = 'secret'
SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY = 'key'
SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET = 'secret'
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'key'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'secret'
SOCIAL_AUTH_KHANACADEMY_OAUTH1_KEY = 'key'
SOCIAL_AUTH_KHANACADEMY_OAUTH1_SECRET = 'secret'
# When we will use email auth we need to define SMTP settings
EMAIL_USE_TLS = True
EMAIL_HOST = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 587
EMAIL_FROM = ''
#We can re-define auth backend(s)
AUTHENTICATION_BACKENDS = (
# 'social.backends.twitter.TwitterOAuth',
# 'social.backends.facebook.FacebookOAuth2',
# 'social.backends.google.GoogleOAuth2',
# 'social.backends.linkedin.LinkedinOAuth2',
# 'social.backends.khanacademy.KhanAcademyOAuth1',
# 'psa.custom_backends.EmailAuth',
'django.contrib.auth.backends.ModelBackend',
)
To install requirements: ::
pip install -r requirements/dev.txt
Download GeoIp database (run commands in the root of the project): ::
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
Go to the root of the project and run this command: ::
docker-compose up courselets
Here we have 2 docker config files:
There are a couple of files related to docker. They are:
How to test this functionality:
test MultChoices
test MultChoices
course with a couple of cocurselets inside of it.To create unit with multiple choices:
kind
Question
(ORCT
)::
[choices] () a (*) b () c () d
Where: not correct answer is empty parenthes ()
and correct answer is (*)
sub_kind
to Multiple choices
Courselet Preview
to view changes.To create a thread with numbers answer (and grading):
kind
Question
(ORCT
)input this text in Question
field for example: .. math:: F=mg
Please note that ..
and ::
are required .. math::
is a prefix to find formulas.
Answer
fieldsub_kind
to Equation
Preview Courselet
To create a thread with numbers answer (and grading):
kind
Question
(ORCT
)Question
field for example: 1+1=?
Answer
sub_kind
to Numbers
, also you can enable autograding with Enable autograding checkbox
Number value
- it's exact answer for this questionNumber max value
and Number min value
- this is precision.Number min value <= Number value <= Number max value
Preview Courselet
To create a thread with canvas answer:
kind
Question
(ORCT
)Question
field for example: Paint number 1
sub_kind
to Canvas
Preview Courselet
We can check code quality using ./check-quality.sh {pep8|pylint} {lti|psa|fsm|ct|mysite|all}
script.
We encourage you to run this script before each commit.
We can switch on and switch off different features. By default all features are switched off. Here's a list of switches:
Get Started
pageNeed to set following secret variables:
When user tries to go to CTMS page, but has no Instructor instance attached, user will not see page but will see the error message. Error 404, because user's who are not instructor has no access to this part of site.
That's why we created new page named Instructor Agreement
, which should be added through admin CMS with custom content.
/admin/cms/page
Instructor Agreement
(or with any other name, but remember URL to this page)mysite/settings/base.py
file and check BECOME_INSTRUCTOR_URL
.BECOME_INSTRUCTOR_URL
must be the same as URL of Instructor Agreement
page.fill the following settings in order to have ability to send emails AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCESS_KEY = '' AWS_SES_REGION_NAME = '' AWS_SES_REGION_ENDPOINT = ''
Practice exam sample calculation config ::
{
"bp_student_number": {
"max": 500,
"min": 0,
"step": 1,
"type": "number",
"label": "How many student do you have in class?",
"default": "200",
"order": 0
},
"average_score": {
"max": 100,
"min": 0,
"step": 1,
"type": "number",
"label": "What is the mean is percent score on a typical exam?",
"default": "72",
"subtype": "percent",
"order": 1
},
"question_parts": {
"max": 200,
"min": 0,
"step": 1,
"type": "number",
"label": "How many question-parts do you have in a typical exam?",
"default": "24",
"label_explanation": "e.g. 8 questions with 3 parts each = 24",
"order": 2
},
"misconception_a_day": {
"max": 500,
"min": 0,
"step": 1,
"type": "number",
"label": "How many individual student misconception do you fix in a typical exam?",
"default": "5",
"order": 3
}
}
Field attributes ::
type: Field type (number, string, date)
order: order in the field list
min: min number value
max: max number value
step: step to increase/decrease number value
label: input value
label_explanation: additional text for label_explanation
default: default value