diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..733a70a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.mol diff --git a/Live-LeastWorkingModel.py b/Live-LeastWorkingModel.py index 6db5743..c8eb93a 100644 --- a/Live-LeastWorkingModel.py +++ b/Live-LeastWorkingModel.py @@ -2,12 +2,14 @@ import numpy as np import sys import math +import cirpy +import Visualization.query as query def printHelpText(): print 'Welcome to our Least Working Program for IPRO 207 in Spring 2016' #End Function printHelpText() -def distance3D(x,y): +def distance3D(x,y): return ((1.0*x[0]-y[0])**2+(1.0*x[1]-y[1])**2+(1.0*x[2]-y[2])**2)**(0.5) #End Function distance() def distance2D(x,y): @@ -41,7 +43,7 @@ def nearestNeighbor(colors, pixel): d=distance3D(pixel, c) if dist==-1 or d= self.shape[0]: continue + if y+dy <0: continue + if y+dy >= self.shape[1]: continue + total[0] = total[0]+self.array[x+dx][y+dy][0] + total[1] = total[1]+self.array[x+dx][y+dy][1] + total[2] = total[2]+self.array[x+dx][y+dy][2] + count=count+1 + total[0]=total[0]/count + total[1]=total[1]/count + total[2]=total[2]/count + return total + + def _nearestNeighbor(self, pixel): + dist = -1 + index=-1 + i=0 + for c in self._colorsBGR: + d = self._distance3D(pixel, c) + if dist==-1 or d5*c1[2] or distance>5*c2[2]: return False + STEPS =25 + PERCENT_SKIP=0.3 + THRESHOLD=0.85 + p1 = c1*PERCENT_SKIP + c2*(1-PERCENT_SKIP) + p2 = c2*PERCENT_SKIP + c1*(1-PERCENT_SKIP) + direction = p2-p1 + count=0 + for i in range(STEPS): + step = direction*i/STEPS + test = p1 + step + if abs(self._distance3D(self.array[int(math.floor(test[1]))][int(math.floor(test[0]))], [185,135,135]))<45: + count = count+1 + return count>THRESHOLD + + def _DFS(self): + if self._graph==None or self._graph==[]: return None + start = 0 + while len(self._graph[start])==0: + start+=1 + if start==len(self._graph): return None + seen = [False]*len(self._graph) + self._edgeRemovalCounter=0 + self._removeCycles(seen,start,None) + ret='' + seen = [False]*len(self._graph) + return self._recursiveDFS(seen, start, None) + + def _removeCycles(self, seen, cur, parent): + seen[cur] = True + for j in self._graph[cur]: + if j==parent: + continue + if seen[j]: + self._graph[cur].remove(j) + self._vertexNames[cur] += self._numberString(self._edgeRemovalCounter) + self._graph[j].remove(cur) + self._vertexNames[j] += self._numberString(self._edgeRemovalCounter) + self._edgeRemovalCounter += 1 + continue + self._removeCycles(seen, j, cur) + + def _numberString(self, i): + if i<10: return str(i) + return '%'+str(i) + + def _recursiveDFS(self, seen, cur, parent): + #Assuming graph is acyclic + seen[cur] = True + ret = self._vertexNames[cur] + count=0 + if parent==None: count=-1 + for j in self._graph[cur]: + if j==parent: + continue + if seen[j]: + continue + count=count+1 + if not count==len(self._graph[cur])-1: + ret=ret+'(' + ret=ret+self._recursiveDFS(seen, j, cur) + if not count==len(self._graph[cur])-1: + ret=ret+')' + return ret + + +def macro(image, ratio): + model = Detection(image) + model.resize(ratio) + model.detectModel() + #model.writeImage("detected.jpg") + return model.SMILES + +@csrf_exempt +def detect(request): + data = {"success": False} + if request.method == "POST": + print "POST method!" + if request.FILES.get("image", None) is not None: + print 'get image from stream' + image = _grab_image(stream=request.FILES["image"]) + else: + print 'Not stream' + url = request.POST.get("url", None) + if url is None: + print 'No URL' + data["error"] = "No URL provided." + return HttpResponse(json.dumps(data), content_type='application/json') + image = _grab_image(url=url) + model = Detection(image) + model.resize(1.0) + print model.image + model.detectModel() + SMILES = model.SMILES + #SMILES = macro(image, 1.0) + if (not SMILES): + SMILES = 'None' + data.update({"SMILES": SMILES, "success": True}) + return HttpResponse(json.dumps(data), content_type='application/json') + + +def _grab_image(path=None, stream=None, url=None): + # if the path is not None, then load the image from disk + if path is not None: + image = cv2.imread(path) + + # otherwise, the image does not reside on disk + else: + # if the URL is not None, then download the image + if url is not None: + resp = urllib.urlopen(url) + data = resp.read() + + # if the stream is not None, then the image has been uploaded + elif stream is not None: + data = stream.read() + + # convert the image to a NumPy array and then read it into + # OpenCV format + image = np.asarray(bytearray(data), dtype="uint8") + image = cv2.imdecode(image, cv2.IMREAD_COLOR) + + # return the image + return image + diff --git a/django13api/detect/views.pyc b/django13api/detect/views.pyc new file mode 100755 index 0000000..8682114 Binary files /dev/null and b/django13api/detect/views.pyc differ diff --git a/django13api/manage.py b/django13api/manage.py new file mode 100755 index 0000000..dc4890a --- /dev/null +++ b/django13api/manage.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python2.7 +from django.core.management import execute_manager +import imp +try: + imp.find_module('settings') # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) + sys.exit(1) + +import settings + +if __name__ == "__main__": + execute_manager(settings) diff --git a/django13api/settings.py b/django13api/settings.py new file mode 100755 index 0000000..68c947b --- /dev/null +++ b/django13api/settings.py @@ -0,0 +1,153 @@ +# Django settings for detection project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': '', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} + +# Hosts/domain names that are valid for this site; required if DEBUG is False +# See https://docs.djangoproject.com/en/1.3/ref/settings/#allowed-hosts +ALLOWED_HOSTS = [] + + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale +USE_L10N = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = '/home/BrumeBleu/detection/media' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '/media/' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = '/home/BrumeBleu/detection/static' + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' + +# URL prefix for admin static files -- CSS, JavaScript and images. +# Make sure to use a trailing slash. +# Examples: "http://foo.com/static/admin/", "/static/admin/". +ADMIN_MEDIA_PREFIX = '/static/admin/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'jmo7gjk88%pav69^04e1fmc)uct9tt_sfj=_3(ei=uh=@6r_lx' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + #'django.template.loaders.eggs.Loader', +) + +MIDDLEWARE_CLASSES = ( + 'corsheaders.middleware.CorsMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', +) +CORS_ORIGIN_ALLOW_ALL = True +ROOT_URLCONF = 'detection.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'detection.detect', + 'corsheaders', + # Uncomment the next line to enable the admin: + # 'django.contrib.admin', + # Uncomment the next line to enable admin documentation: + # 'django.contrib.admindocs', +) + +# A sample logging configuration. The only tangible logging +# performed by this configuration is to send an email to +# the site admins on every HTTP 500 error. +# See http://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler' + } + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} diff --git a/django13api/settings.pyc b/django13api/settings.pyc new file mode 100755 index 0000000..96aa229 Binary files /dev/null and b/django13api/settings.pyc differ diff --git a/django13api/urls.py b/django13api/urls.py new file mode 100755 index 0000000..f6c91b7 --- /dev/null +++ b/django13api/urls.py @@ -0,0 +1,18 @@ +from django.conf.urls.defaults import patterns, include, url + +# Uncomment the next two lines to enable the admin: +# from django.contrib import admin +# admin.autodiscover() + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'detection.views.home', name='home'), + # url(r'^detection/', include('detection.foo.urls')), + + # Uncomment the admin/doc line below to enable admin documentation: + # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + # url(r'^admin/', include(admin.site.urls)), + url(r'^detect/$', 'detect.views.detect'), +) diff --git a/django13api/urls.pyc b/django13api/urls.pyc new file mode 100755 index 0000000..36f03e4 Binary files /dev/null and b/django13api/urls.pyc differ diff --git a/leastWorkingModel.py b/leastWorkingModel.py index d6ee58a..957e649 100644 --- a/leastWorkingModel.py +++ b/leastWorkingModel.py @@ -7,7 +7,7 @@ def printHelpText(): #End Function printHelpText() cap = cv2.VideoCapture(0) -cv2.namedWindow('Ball And Stick Tracker',cv2.CV_WINDOW_AUTOSIZE) +cv2.namedWindow('Ball And Stick Tracker',cv2.WINDOW_AUTOSIZE) printHelpText() @@ -24,7 +24,7 @@ def printHelpText(): retval,image = cap.read() cv2.imshow('Ball And Stick Tracker', image) key = cv2.waitKey(5) - #End If + #End If currentImage = cv2.medianBlur(image,5) while True: diff --git a/quizAngular/.bowerrc b/quizAngular/.bowerrc new file mode 100755 index 0000000..69fad35 --- /dev/null +++ b/quizAngular/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/quizAngular/.editorconfig b/quizAngular/.editorconfig new file mode 100755 index 0000000..c2cdfb8 --- /dev/null +++ b/quizAngular/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/quizAngular/.gitattributes b/quizAngular/.gitattributes new file mode 100755 index 0000000..2125666 --- /dev/null +++ b/quizAngular/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/quizAngular/.gitignore b/quizAngular/.gitignore new file mode 100755 index 0000000..2421ac0 --- /dev/null +++ b/quizAngular/.gitignore @@ -0,0 +1,4 @@ +node_modules +.tmp +.sass-cache +bower_components diff --git a/quizAngular/.jshintrc b/quizAngular/.jshintrc new file mode 100755 index 0000000..f750969 --- /dev/null +++ b/quizAngular/.jshintrc @@ -0,0 +1,23 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "globals": { + "angular": false + } +} diff --git a/quizAngular/.yo-rc.json b/quizAngular/.yo-rc.json new file mode 100755 index 0000000..6589676 --- /dev/null +++ b/quizAngular/.yo-rc.json @@ -0,0 +1,11 @@ +{ + "generator-karma": { + "base-path": "../", + "frameworks": "jasmine", + "browsers": "PhantomJS", + "app-files": "app/scripts/**/*.js", + "files-comments": "bower:js,endbower", + "bower-components-path": "bower_components", + "test-files": "test/mock/**/*.js,test/spec/**/*.js" + } +} \ No newline at end of file diff --git a/quizAngular/Gruntfile.js b/quizAngular/Gruntfile.js new file mode 100755 index 0000000..f698c61 --- /dev/null +++ b/quizAngular/Gruntfile.js @@ -0,0 +1,444 @@ +// Generated on 2016-04-03 using generator-angular 0.11.1 +'use strict'; + +// # Globbing +// for performance reasons we're only matching one level down: +// 'test/spec/{,*/}*.js' +// use this if you want to recursively match all subfolders: +// 'test/spec/**/*.js' + +module.exports = function (grunt) { + + // Load grunt tasks automatically + require('load-grunt-tasks')(grunt); + + // Time how long tasks take. Can help when optimizing build times + require('time-grunt')(grunt); + + // Configurable paths for the application + var appConfig = { + app: require('./bower.json').appPath || 'app', + dist: 'dist' + }; + + // Define the configuration for all the tasks + grunt.initConfig({ + + // Project settings + yeoman: appConfig, + + // Watches files for changes and runs tasks based on the changed files + watch: { + bower: { + files: ['bower.json'], + tasks: ['wiredep'] + }, + js: { + files: ['<%= yeoman.app %>/scripts/{,*/}*.js'], + tasks: ['newer:jshint:all'], + options: { + livereload: '<%= connect.options.livereload %>' + } + }, + jsTest: { + files: ['test/spec/{,*/}*.js'], + tasks: ['newer:jshint:test', 'karma'] + }, + styles: { + files: ['<%= yeoman.app %>/styles/{,*/}*.css'], + tasks: ['newer:copy:styles', 'autoprefixer'] + }, + gruntfile: { + files: ['Gruntfile.js'] + }, + livereload: { + options: { + livereload: '<%= connect.options.livereload %>' + }, + files: [ + '<%= yeoman.app %>/{,*/}*.html', + '.tmp/styles/{,*/}*.css', + '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' + ] + } + }, + + // The actual grunt server settings + connect: { + options: { + port: 9000, + // Change this to '0.0.0.0' to access the server from outside. + hostname: 'localhost', + livereload: 35729 + }, + livereload: { + options: { + open: true, + middleware: function (connect) { + return [ + connect.static('.tmp'), + connect().use( + '/bower_components', + connect.static('./bower_components') + ), + connect().use( + '/app/styles', + connect.static('./app/styles') + ), + connect.static(appConfig.app) + ]; + } + } + }, + test: { + options: { + port: 9001, + middleware: function (connect) { + return [ + connect.static('.tmp'), + connect.static('test'), + connect().use( + '/bower_components', + connect.static('./bower_components') + ), + connect.static(appConfig.app) + ]; + } + } + }, + dist: { + options: { + open: true, + base: '<%= yeoman.dist %>' + } + } + }, + + // Make sure code styles are up to par and there are no obvious mistakes + jshint: { + options: { + jshintrc: '.jshintrc', + reporter: require('jshint-stylish') + }, + all: { + src: [ + 'Gruntfile.js', + '<%= yeoman.app %>/scripts/{,*/}*.js' + ] + }, + test: { + options: { + jshintrc: 'test/.jshintrc' + }, + src: ['test/spec/{,*/}*.js'] + } + }, + + // Empties folders to start fresh + clean: { + dist: { + files: [{ + dot: true, + src: [ + '.tmp', + '<%= yeoman.dist %>/{,*/}*', + '!<%= yeoman.dist %>/.git{,*/}*' + ] + }] + }, + server: '.tmp' + }, + + // Add vendor prefixed styles + autoprefixer: { + options: { + browsers: ['last 1 version'] + }, + server: { + options: { + map: true, + }, + files: [{ + expand: true, + cwd: '.tmp/styles/', + src: '{,*/}*.css', + dest: '.tmp/styles/' + }] + }, + dist: { + files: [{ + expand: true, + cwd: '.tmp/styles/', + src: '{,*/}*.css', + dest: '.tmp/styles/' + }] + } + }, + + // Automatically inject Bower components into the app + wiredep: { + app: { + src: ['<%= yeoman.app %>/index.html'], + ignorePath: /\.\.\// + }, + test: { + devDependencies: true, + src: '<%= karma.unit.configFile %>', + ignorePath: /\.\.\//, + fileTypes:{ + js: { + block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi, + detect: { + js: /'(.*\.js)'/gi + }, + replace: { + js: '\'{{filePath}}\',' + } + } + } + } + }, + + // Renames files for browser caching purposes + filerev: { + dist: { + src: [ + '<%= yeoman.dist %>/scripts/{,*/}*.js', + '<%= yeoman.dist %>/styles/{,*/}*.css', + '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', + '<%= yeoman.dist %>/styles/fonts/*' + ] + } + }, + + // Reads HTML for usemin blocks to enable smart builds that automatically + // concat, minify and revision files. Creates configurations in memory so + // additional tasks can operate on them + useminPrepare: { + html: '<%= yeoman.app %>/index.html', + options: { + dest: '<%= yeoman.dist %>', + flow: { + html: { + steps: { + js: ['concat', 'uglifyjs'], + css: ['cssmin'] + }, + post: {} + } + } + } + }, + + // Performs rewrites based on filerev and the useminPrepare configuration + usemin: { + html: ['<%= yeoman.dist %>/{,*/}*.html'], + css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], + options: { + assetsDirs: [ + '<%= yeoman.dist %>', + '<%= yeoman.dist %>/images', + '<%= yeoman.dist %>/styles' + ] + } + }, + + // The following *-min tasks will produce minified files in the dist folder + // By default, your `index.html`'s will take care of + // minification. These next options are pre-configured if you do not wish + // to use the Usemin blocks. + // cssmin: { + // dist: { + // files: { + // '<%= yeoman.dist %>/styles/main.css': [ + // '.tmp/styles/{,*/}*.css' + // ] + // } + // } + // }, + // uglify: { + // dist: { + // files: { + // '<%= yeoman.dist %>/scripts/scripts.js': [ + // '<%= yeoman.dist %>/scripts/scripts.js' + // ] + // } + // } + // }, + // concat: { + // dist: {} + // }, + + imagemin: { + dist: { + files: [{ + expand: true, + cwd: '<%= yeoman.app %>/images', + src: '{,*/}*.{png,jpg,jpeg,gif}', + dest: '<%= yeoman.dist %>/images' + }] + } + }, + + svgmin: { + dist: { + files: [{ + expand: true, + cwd: '<%= yeoman.app %>/images', + src: '{,*/}*.svg', + dest: '<%= yeoman.dist %>/images' + }] + } + }, + + htmlmin: { + dist: { + options: { + collapseWhitespace: true, + conservativeCollapse: true, + collapseBooleanAttributes: true, + removeCommentsFromCDATA: true, + removeOptionalTags: true + }, + files: [{ + expand: true, + cwd: '<%= yeoman.dist %>', + src: ['*.html', 'views/{,*/}*.html'], + dest: '<%= yeoman.dist %>' + }] + } + }, + + // ng-annotate tries to make the code safe for minification automatically + // by using the Angular long form for dependency injection. + ngAnnotate: { + dist: { + files: [{ + expand: true, + cwd: '.tmp/concat/scripts', + src: '*.js', + dest: '.tmp/concat/scripts' + }] + } + }, + + // Replace Google CDN references + cdnify: { + dist: { + html: ['<%= yeoman.dist %>/*.html'] + } + }, + + // Copies remaining files to places other tasks can use + copy: { + dist: { + files: [{ + expand: true, + dot: true, + cwd: '<%= yeoman.app %>', + dest: '<%= yeoman.dist %>', + src: [ + '*.{ico,png,txt}', + '.htaccess', + '*.html', + 'views/{,*/}*.html', + 'images/**/*', + 'styles/fonts/{,*/}*.*', + ] + }, { + expand: true, + cwd: '.tmp/images', + dest: '<%= yeoman.dist %>/images', + src: ['generated/*'] + }, { + expand: true, + cwd: 'bower_components/bootstrap/dist', + src: 'fonts/*', + dest: '<%= yeoman.dist %>' + }] + }, + styles: { + expand: true, + cwd: '<%= yeoman.app %>/styles', + dest: '.tmp/styles/', + src: '{,*/}*.css' + } + }, + + // Run some tasks in parallel to speed up the build process + concurrent: { + server: [ + 'copy:styles' + ], + test: [ + 'copy:styles' + ], + dist: [ + 'copy:styles', + 'imagemin', + 'svgmin' + ] + }, + + // Test settings + karma: { + unit: { + configFile: 'test/karma.conf.js', + singleRun: true + } + } + }); + + + grunt.registerTask('serve', 'Compile then start a connect web server', function (target) { + if (target === 'dist') { + return grunt.task.run(['build', 'connect:dist:keepalive']); + } + + grunt.task.run([ + 'clean:server', + 'wiredep', + 'concurrent:server', + 'autoprefixer:server', + 'connect:livereload', + 'watch' + ]); + }); + + grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) { + grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); + grunt.task.run(['serve:' + target]); + }); + + grunt.registerTask('test', [ + 'clean:server', + 'wiredep', + 'concurrent:test', + 'autoprefixer', + 'connect:test', + 'karma' + ]); + + grunt.registerTask('build', [ + 'clean:dist', + 'wiredep', + 'useminPrepare', + 'concurrent:dist', + 'autoprefixer', + 'concat', + 'ngAnnotate', + 'copy:dist', + 'cdnify', + 'cssmin', + 'uglify', + 'filerev', + 'usemin', + 'htmlmin' + ]); + + grunt.registerTask('default', [ + 'newer:jshint', + 'test', + 'build' + ]); +}; diff --git a/quizAngular/Procfile b/quizAngular/Procfile new file mode 100644 index 0000000..ae7366d --- /dev/null +++ b/quizAngular/Procfile @@ -0,0 +1 @@ +web: node web.js diff --git a/quizAngular/README.md b/quizAngular/README.md new file mode 100755 index 0000000..91200fc --- /dev/null +++ b/quizAngular/README.md @@ -0,0 +1,16 @@ +# quiz-angular + +This project is generated with [yo angular generator](https://github.com/yeoman/generator-angular) +version 0.11.1. + +## Build & development + +Run `grunt` for building and `grunt serve` for preview. + +## Testing + +Running `grunt test` will run the unit tests with karma. + +## Deployment + +This app is deployed by Heroku at this [url](https://ipro207quizapp.herokuapp.com/#/). diff --git a/quizAngular/app/.buildignore b/quizAngular/app/.buildignore new file mode 100755 index 0000000..fc98b8e --- /dev/null +++ b/quizAngular/app/.buildignore @@ -0,0 +1 @@ +*.coffee \ No newline at end of file diff --git a/quizAngular/app/.htaccess b/quizAngular/app/.htaccess new file mode 100755 index 0000000..cb84cb9 --- /dev/null +++ b/quizAngular/app/.htaccess @@ -0,0 +1,543 @@ +# Apache Configuration File + +# (!) Using `.htaccess` files slows down Apache, therefore, if you have access +# to the main server config file (usually called `httpd.conf`), you should add +# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html. + +# ############################################################################## +# # CROSS-ORIGIN RESOURCE SHARING (CORS) # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Cross-domain AJAX requests | +# ------------------------------------------------------------------------------ + +# Enable cross-origin AJAX requests. +# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity +# http://enable-cors.org/ + +# +# Header set Access-Control-Allow-Origin "*" +# + +# ------------------------------------------------------------------------------ +# | CORS-enabled images | +# ------------------------------------------------------------------------------ + +# Send the CORS header for images when browsers request it. +# https://developer.mozilla.org/en/CORS_Enabled_Image +# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html +# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ + + + + + SetEnvIf Origin ":" IS_CORS + Header set Access-Control-Allow-Origin "*" env=IS_CORS + + + + +# ------------------------------------------------------------------------------ +# | Web fonts access | +# ------------------------------------------------------------------------------ + +# Allow access from all domains for web fonts + + + + Header set Access-Control-Allow-Origin "*" + + + + +# ############################################################################## +# # ERRORS # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | 404 error prevention for non-existing redirected folders | +# ------------------------------------------------------------------------------ + +# Prevent Apache from returning a 404 error for a rewrite if a directory +# with the same name does not exist. +# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews +# http://www.webmasterworld.com/apache/3808792.htm + +Options -MultiViews + +# ------------------------------------------------------------------------------ +# | Custom error messages / pages | +# ------------------------------------------------------------------------------ + +# You can customize what Apache returns to the client in case of an error (see +# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.: + +ErrorDocument 404 /404.html + + +# ############################################################################## +# # INTERNET EXPLORER # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Better website experience | +# ------------------------------------------------------------------------------ + +# Force IE to render pages in the highest available mode in the various +# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf. + + + Header set X-UA-Compatible "IE=edge" + # `mod_headers` can't match based on the content-type, however, we only + # want to send this header for HTML pages and not for the other resources + + Header unset X-UA-Compatible + + + +# ------------------------------------------------------------------------------ +# | Cookie setting from iframes | +# ------------------------------------------------------------------------------ + +# Allow cookies to be set from iframes in IE. + +# +# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"" +# + +# ------------------------------------------------------------------------------ +# | Screen flicker | +# ------------------------------------------------------------------------------ + +# Stop screen flicker in IE on CSS rollovers (this only works in +# combination with the `ExpiresByType` directives for images from below). + +# BrowserMatch "MSIE" brokenvary=1 +# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 +# BrowserMatch "Opera" !brokenvary +# SetEnvIf brokenvary 1 force-no-vary + + +# ############################################################################## +# # MIME TYPES AND ENCODING # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Proper MIME types for all files | +# ------------------------------------------------------------------------------ + + + + # Audio + AddType audio/mp4 m4a f4a f4b + AddType audio/ogg oga ogg + + # JavaScript + # Normalize to standard type (it's sniffed in IE anyways): + # http://tools.ietf.org/html/rfc4329#section-7.2 + AddType application/javascript js jsonp + AddType application/json json + + # Video + AddType video/mp4 mp4 m4v f4v f4p + AddType video/ogg ogv + AddType video/webm webm + AddType video/x-flv flv + + # Web fonts + AddType application/font-woff woff + AddType application/vnd.ms-fontobject eot + + # Browsers usually ignore the font MIME types and sniff the content, + # however, Chrome shows a warning if other MIME types are used for the + # following fonts. + AddType application/x-font-ttf ttc ttf + AddType font/opentype otf + + # Make SVGZ fonts work on iPad: + # https://twitter.com/FontSquirrel/status/14855840545 + AddType image/svg+xml svg svgz + AddEncoding gzip svgz + + # Other + AddType application/octet-stream safariextz + AddType application/x-chrome-extension crx + AddType application/x-opera-extension oex + AddType application/x-shockwave-flash swf + AddType application/x-web-app-manifest+json webapp + AddType application/x-xpinstall xpi + AddType application/xml atom rdf rss xml + AddType image/webp webp + AddType image/x-icon ico + AddType text/cache-manifest appcache manifest + AddType text/vtt vtt + AddType text/x-component htc + AddType text/x-vcard vcf + + + +# ------------------------------------------------------------------------------ +# | UTF-8 encoding | +# ------------------------------------------------------------------------------ + +# Use UTF-8 encoding for anything served as `text/html` or `text/plain`. +AddDefaultCharset utf-8 + +# Force UTF-8 for certain file formats. + + AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml + + + +# ############################################################################## +# # URL REWRITES # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Rewrite engine | +# ------------------------------------------------------------------------------ + +# Turning on the rewrite engine and enabling the `FollowSymLinks` option is +# necessary for the following directives to work. + +# If your web host doesn't allow the `FollowSymlinks` option, you may need to +# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the +# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks + +# Also, some cloud hosting services require `RewriteBase` to be set: +# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site + + + Options +FollowSymlinks + # Options +SymLinksIfOwnerMatch + RewriteEngine On + # RewriteBase / + + +# ------------------------------------------------------------------------------ +# | Suppressing / Forcing the "www." at the beginning of URLs | +# ------------------------------------------------------------------------------ + +# The same content should never be available under two different URLs especially +# not with and without "www." at the beginning. This can cause SEO problems +# (duplicate content), therefore, you should choose one of the alternatives and +# redirect the other one. + +# By default option 1 (no "www.") is activated: +# http://no-www.org/faq.php?q=class_b + +# If you'd prefer to use option 2, just comment out all the lines from option 1 +# and uncomment the ones from option 2. + +# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME! + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Option 1: rewrite www.example.com → example.com + + + RewriteCond %{HTTPS} !=on + RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] + RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Option 2: rewrite example.com → www.example.com + +# Be aware that the following might not be a good idea if you use "real" +# subdomains for certain parts of your website. + +# +# RewriteCond %{HTTPS} !=on +# RewriteCond %{HTTP_HOST} !^www\..+$ [NC] +# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] +# + + +# ############################################################################## +# # SECURITY # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Content Security Policy (CSP) | +# ------------------------------------------------------------------------------ + +# You can mitigate the risk of cross-site scripting and other content-injection +# attacks by setting a Content Security Policy which whitelists trusted sources +# of content for your site. + +# The example header below allows ONLY scripts that are loaded from the current +# site's origin (no inline scripts, no CDN, etc). This almost certainly won't +# work as-is for your site! + +# To get all the details you'll need to craft a reasonable policy for your site, +# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or +# see the specification: http://w3.org/TR/CSP). + +# +# Header set Content-Security-Policy "script-src 'self'; object-src 'self'" +# +# Header unset Content-Security-Policy +# +# + +# ------------------------------------------------------------------------------ +# | File access | +# ------------------------------------------------------------------------------ + +# Block access to directories without a default document. +# Usually you should leave this uncommented because you shouldn't allow anyone +# to surf through every directory on your server (which may includes rather +# private places like the CMS's directories). + + + Options -Indexes + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Block access to hidden files and directories. +# This includes directories used by version control systems such as Git and SVN. + + + RewriteCond %{SCRIPT_FILENAME} -d [OR] + RewriteCond %{SCRIPT_FILENAME} -f + RewriteRule "(^|/)\." - [F] + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Block access to backup and source files. +# These files may be left by some text editors and can pose a great security +# danger when anyone has access to them. + + + Order allow,deny + Deny from all + Satisfy All + + +# ------------------------------------------------------------------------------ +# | Secure Sockets Layer (SSL) | +# ------------------------------------------------------------------------------ + +# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.: +# prevent `https://www.example.com` when your certificate only allows +# `https://secure.example.com`. + +# +# RewriteCond %{SERVER_PORT} !^443 +# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L] +# + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Force client-side SSL redirection. + +# If a user types "example.com" in his browser, the above rule will redirect him +# to the secure version of the site. That still leaves a window of opportunity +# (the initial HTTP connection) for an attacker to downgrade or redirect the +# request. The following header ensures that browser will ONLY connect to your +# server via HTTPS, regardless of what the users type in the address bar. +# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/ + +# +# Header set Strict-Transport-Security max-age=16070400; +# + +# ------------------------------------------------------------------------------ +# | Server software information | +# ------------------------------------------------------------------------------ + +# Avoid displaying the exact Apache version number, the description of the +# generic OS-type and the information about Apache's compiled-in modules. + +# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`! + +# ServerTokens Prod + + +# ############################################################################## +# # WEB PERFORMANCE # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Compression | +# ------------------------------------------------------------------------------ + + + + # Force compression for mangled headers. + # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # Compress all output labeled with one of the following MIME-types + # (for Apache versions below 2.3.7, you don't need to enable `mod_filter` + # and can remove the `` and `` lines + # as `AddOutputFilterByType` is still in the core directives). + + AddOutputFilterByType DEFLATE application/atom+xml \ + application/javascript \ + application/json \ + application/rss+xml \ + application/vnd.ms-fontobject \ + application/x-font-ttf \ + application/x-web-app-manifest+json \ + application/xhtml+xml \ + application/xml \ + font/opentype \ + image/svg+xml \ + image/x-icon \ + text/css \ + text/html \ + text/plain \ + text/x-component \ + text/xml + + + + +# ------------------------------------------------------------------------------ +# | Content transformations | +# ------------------------------------------------------------------------------ + +# Prevent some of the mobile network providers from modifying the content of +# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5. + +# +# Header set Cache-Control "no-transform" +# + +# ------------------------------------------------------------------------------ +# | ETag removal | +# ------------------------------------------------------------------------------ + +# Since we're sending far-future expires headers (see below), ETags can +# be removed: http://developer.yahoo.com/performance/rules.html#etags. + +# `FileETag None` is not enough for every server. + + Header unset ETag + + +FileETag None + +# ------------------------------------------------------------------------------ +# | Expires headers (for better cache control) | +# ------------------------------------------------------------------------------ + +# The following expires headers are set pretty far in the future. If you don't +# control versioning with filename-based cache busting, consider lowering the +# cache time for resources like CSS and JS to something like 1 week. + + + + ExpiresActive on + ExpiresDefault "access plus 1 month" + + # CSS + ExpiresByType text/css "access plus 1 year" + + # Data interchange + ExpiresByType application/json "access plus 0 seconds" + ExpiresByType application/xml "access plus 0 seconds" + ExpiresByType text/xml "access plus 0 seconds" + + # Favicon (cannot be renamed!) + ExpiresByType image/x-icon "access plus 1 week" + + # HTML components (HTCs) + ExpiresByType text/x-component "access plus 1 month" + + # HTML + ExpiresByType text/html "access plus 0 seconds" + + # JavaScript + ExpiresByType application/javascript "access plus 1 year" + + # Manifest files + ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" + ExpiresByType text/cache-manifest "access plus 0 seconds" + + # Media + ExpiresByType audio/ogg "access plus 1 month" + ExpiresByType image/gif "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType video/mp4 "access plus 1 month" + ExpiresByType video/ogg "access plus 1 month" + ExpiresByType video/webm "access plus 1 month" + + # Web feeds + ExpiresByType application/atom+xml "access plus 1 hour" + ExpiresByType application/rss+xml "access plus 1 hour" + + # Web fonts + ExpiresByType application/font-woff "access plus 1 month" + ExpiresByType application/vnd.ms-fontobject "access plus 1 month" + ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/opentype "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + + + +# ------------------------------------------------------------------------------ +# | Filename-based cache busting | +# ------------------------------------------------------------------------------ + +# If you're not using a build process to manage your filename version revving, +# you might want to consider enabling the following directives to route all +# requests such as `/css/style.12345.css` to `/css/style.css`. + +# To understand why this is important and a better idea than `*.css?v231`, read: +# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring + +# +# RewriteCond %{REQUEST_FILENAME} !-f +# RewriteCond %{REQUEST_FILENAME} !-d +# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] +# + +# ------------------------------------------------------------------------------ +# | File concatenation | +# ------------------------------------------------------------------------------ + +# Allow concatenation from within specific CSS and JS files, e.g.: +# Inside of `script.combined.js` you could have +# +# +# and they would be included into this single file. + +# +# +# Options +Includes +# AddOutputFilterByType INCLUDES application/javascript application/json +# SetOutputFilter INCLUDES +# +# +# Options +Includes +# AddOutputFilterByType INCLUDES text/css +# SetOutputFilter INCLUDES +# +# + +# ------------------------------------------------------------------------------ +# | Persistent connections | +# ------------------------------------------------------------------------------ + +# Allow multiple requests to be sent over the same TCP connection: +# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive. + +# Enable if you serve a lot of static content but, be aware of the +# possible disadvantages! + +# +# Header set Connection Keep-Alive +# diff --git a/quizAngular/app/404.html b/quizAngular/app/404.html new file mode 100755 index 0000000..f5c3819 --- /dev/null +++ b/quizAngular/app/404.html @@ -0,0 +1,157 @@ + + + + + Page Not Found :( + + + +
+

Not found :(

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+
    +
  • a mistyped address
  • +
  • an out-of-date link
  • +
+ + +
+ + diff --git a/quizAngular/app/favicon (1).ico b/quizAngular/app/favicon (1).ico new file mode 100755 index 0000000..af1b65b Binary files /dev/null and b/quizAngular/app/favicon (1).ico differ diff --git a/quizAngular/app/images/1.PNG b/quizAngular/app/images/1.PNG new file mode 100755 index 0000000..ee2b827 Binary files /dev/null and b/quizAngular/app/images/1.PNG differ diff --git a/quizAngular/app/images/10.PNG b/quizAngular/app/images/10.PNG new file mode 100755 index 0000000..502aaab Binary files /dev/null and b/quizAngular/app/images/10.PNG differ diff --git a/quizAngular/app/images/11-1.PNG b/quizAngular/app/images/11-1.PNG new file mode 100755 index 0000000..af3066a Binary files /dev/null and b/quizAngular/app/images/11-1.PNG differ diff --git a/quizAngular/app/images/11.PNG b/quizAngular/app/images/11.PNG new file mode 100755 index 0000000..cbfdb15 Binary files /dev/null and b/quizAngular/app/images/11.PNG differ diff --git a/quizAngular/app/images/12.PNG b/quizAngular/app/images/12.PNG new file mode 100755 index 0000000..e0217bd Binary files /dev/null and b/quizAngular/app/images/12.PNG differ diff --git a/quizAngular/app/images/13.PNG b/quizAngular/app/images/13.PNG new file mode 100755 index 0000000..e7966c9 Binary files /dev/null and b/quizAngular/app/images/13.PNG differ diff --git a/quizAngular/app/images/14.PNG b/quizAngular/app/images/14.PNG new file mode 100755 index 0000000..e37929d Binary files /dev/null and b/quizAngular/app/images/14.PNG differ diff --git a/quizAngular/app/images/15.PNG b/quizAngular/app/images/15.PNG new file mode 100755 index 0000000..dd23ee3 Binary files /dev/null and b/quizAngular/app/images/15.PNG differ diff --git a/quizAngular/app/images/16.PNG b/quizAngular/app/images/16.PNG new file mode 100755 index 0000000..aaf2b48 Binary files /dev/null and b/quizAngular/app/images/16.PNG differ diff --git a/quizAngular/app/images/17.PNG b/quizAngular/app/images/17.PNG new file mode 100755 index 0000000..5c66382 Binary files /dev/null and b/quizAngular/app/images/17.PNG differ diff --git a/quizAngular/app/images/18.PNG b/quizAngular/app/images/18.PNG new file mode 100755 index 0000000..929af52 Binary files /dev/null and b/quizAngular/app/images/18.PNG differ diff --git a/quizAngular/app/images/19.PNG b/quizAngular/app/images/19.PNG new file mode 100755 index 0000000..e0a44eb Binary files /dev/null and b/quizAngular/app/images/19.PNG differ diff --git a/quizAngular/app/images/2.PNG b/quizAngular/app/images/2.PNG new file mode 100755 index 0000000..38832f8 Binary files /dev/null and b/quizAngular/app/images/2.PNG differ diff --git a/quizAngular/app/images/20-1.PNG b/quizAngular/app/images/20-1.PNG new file mode 100755 index 0000000..713b6e2 Binary files /dev/null and b/quizAngular/app/images/20-1.PNG differ diff --git a/quizAngular/app/images/20-10.PNG b/quizAngular/app/images/20-10.PNG new file mode 100755 index 0000000..6f8a6fa Binary files /dev/null and b/quizAngular/app/images/20-10.PNG differ diff --git a/quizAngular/app/images/20-11.PNG b/quizAngular/app/images/20-11.PNG new file mode 100755 index 0000000..dbd75a6 Binary files /dev/null and b/quizAngular/app/images/20-11.PNG differ diff --git a/quizAngular/app/images/20-2.PNG b/quizAngular/app/images/20-2.PNG new file mode 100755 index 0000000..6ce1879 Binary files /dev/null and b/quizAngular/app/images/20-2.PNG differ diff --git a/quizAngular/app/images/20-3.PNG b/quizAngular/app/images/20-3.PNG new file mode 100755 index 0000000..0ed1de4 Binary files /dev/null and b/quizAngular/app/images/20-3.PNG differ diff --git a/quizAngular/app/images/20-4.PNG b/quizAngular/app/images/20-4.PNG new file mode 100755 index 0000000..8cf5a98 Binary files /dev/null and b/quizAngular/app/images/20-4.PNG differ diff --git a/quizAngular/app/images/20-5.PNG b/quizAngular/app/images/20-5.PNG new file mode 100755 index 0000000..05fa63a Binary files /dev/null and b/quizAngular/app/images/20-5.PNG differ diff --git a/quizAngular/app/images/20-6.PNG b/quizAngular/app/images/20-6.PNG new file mode 100755 index 0000000..27d3500 Binary files /dev/null and b/quizAngular/app/images/20-6.PNG differ diff --git a/quizAngular/app/images/20-7.PNG b/quizAngular/app/images/20-7.PNG new file mode 100755 index 0000000..b8b674a Binary files /dev/null and b/quizAngular/app/images/20-7.PNG differ diff --git a/quizAngular/app/images/20-8.PNG b/quizAngular/app/images/20-8.PNG new file mode 100755 index 0000000..727d34f Binary files /dev/null and b/quizAngular/app/images/20-8.PNG differ diff --git a/quizAngular/app/images/20-9.PNG b/quizAngular/app/images/20-9.PNG new file mode 100755 index 0000000..3cc8040 Binary files /dev/null and b/quizAngular/app/images/20-9.PNG differ diff --git a/quizAngular/app/images/21-1.PNG b/quizAngular/app/images/21-1.PNG new file mode 100755 index 0000000..08d56c2 Binary files /dev/null and b/quizAngular/app/images/21-1.PNG differ diff --git a/quizAngular/app/images/21-2.PNG b/quizAngular/app/images/21-2.PNG new file mode 100755 index 0000000..5604176 Binary files /dev/null and b/quizAngular/app/images/21-2.PNG differ diff --git a/quizAngular/app/images/21-3.PNG b/quizAngular/app/images/21-3.PNG new file mode 100755 index 0000000..9042ea1 Binary files /dev/null and b/quizAngular/app/images/21-3.PNG differ diff --git a/quizAngular/app/images/21-4.PNG b/quizAngular/app/images/21-4.PNG new file mode 100755 index 0000000..7da3a78 Binary files /dev/null and b/quizAngular/app/images/21-4.PNG differ diff --git a/quizAngular/app/images/21-5.PNG b/quizAngular/app/images/21-5.PNG new file mode 100755 index 0000000..5298340 Binary files /dev/null and b/quizAngular/app/images/21-5.PNG differ diff --git a/quizAngular/app/images/21-6.PNG b/quizAngular/app/images/21-6.PNG new file mode 100755 index 0000000..f455742 Binary files /dev/null and b/quizAngular/app/images/21-6.PNG differ diff --git a/quizAngular/app/images/22-1.PNG b/quizAngular/app/images/22-1.PNG new file mode 100755 index 0000000..51a53fe Binary files /dev/null and b/quizAngular/app/images/22-1.PNG differ diff --git a/quizAngular/app/images/22-2.PNG b/quizAngular/app/images/22-2.PNG new file mode 100755 index 0000000..a6e5202 Binary files /dev/null and b/quizAngular/app/images/22-2.PNG differ diff --git a/quizAngular/app/images/22-3.PNG b/quizAngular/app/images/22-3.PNG new file mode 100755 index 0000000..30db8bf Binary files /dev/null and b/quizAngular/app/images/22-3.PNG differ diff --git a/quizAngular/app/images/22-4.PNG b/quizAngular/app/images/22-4.PNG new file mode 100755 index 0000000..d9cfdc8 Binary files /dev/null and b/quizAngular/app/images/22-4.PNG differ diff --git a/quizAngular/app/images/23-1.PNG b/quizAngular/app/images/23-1.PNG new file mode 100755 index 0000000..8647a74 Binary files /dev/null and b/quizAngular/app/images/23-1.PNG differ diff --git a/quizAngular/app/images/23-2.PNG b/quizAngular/app/images/23-2.PNG new file mode 100755 index 0000000..25252a7 Binary files /dev/null and b/quizAngular/app/images/23-2.PNG differ diff --git a/quizAngular/app/images/23-3.PNG b/quizAngular/app/images/23-3.PNG new file mode 100755 index 0000000..a1d068b Binary files /dev/null and b/quizAngular/app/images/23-3.PNG differ diff --git a/quizAngular/app/images/23-4.PNG b/quizAngular/app/images/23-4.PNG new file mode 100755 index 0000000..9e58b82 Binary files /dev/null and b/quizAngular/app/images/23-4.PNG differ diff --git a/quizAngular/app/images/23-5.PNG b/quizAngular/app/images/23-5.PNG new file mode 100755 index 0000000..fe0043c Binary files /dev/null and b/quizAngular/app/images/23-5.PNG differ diff --git a/quizAngular/app/images/23-6.PNG b/quizAngular/app/images/23-6.PNG new file mode 100755 index 0000000..ba868cd Binary files /dev/null and b/quizAngular/app/images/23-6.PNG differ diff --git a/quizAngular/app/images/23-7.PNG b/quizAngular/app/images/23-7.PNG new file mode 100755 index 0000000..201d5c8 Binary files /dev/null and b/quizAngular/app/images/23-7.PNG differ diff --git a/quizAngular/app/images/24-1.PNG b/quizAngular/app/images/24-1.PNG new file mode 100755 index 0000000..a1c2367 Binary files /dev/null and b/quizAngular/app/images/24-1.PNG differ diff --git a/quizAngular/app/images/24-2.PNG b/quizAngular/app/images/24-2.PNG new file mode 100755 index 0000000..6752930 Binary files /dev/null and b/quizAngular/app/images/24-2.PNG differ diff --git a/quizAngular/app/images/24-3.PNG b/quizAngular/app/images/24-3.PNG new file mode 100755 index 0000000..cc9f1cd Binary files /dev/null and b/quizAngular/app/images/24-3.PNG differ diff --git a/quizAngular/app/images/24-4.PNG b/quizAngular/app/images/24-4.PNG new file mode 100755 index 0000000..99a9902 Binary files /dev/null and b/quizAngular/app/images/24-4.PNG differ diff --git a/quizAngular/app/images/24-5.PNG b/quizAngular/app/images/24-5.PNG new file mode 100755 index 0000000..63a0408 Binary files /dev/null and b/quizAngular/app/images/24-5.PNG differ diff --git a/quizAngular/app/images/24-6.PNG b/quizAngular/app/images/24-6.PNG new file mode 100755 index 0000000..fbe2074 Binary files /dev/null and b/quizAngular/app/images/24-6.PNG differ diff --git a/quizAngular/app/images/25-1.PNG b/quizAngular/app/images/25-1.PNG new file mode 100755 index 0000000..9085a2a Binary files /dev/null and b/quizAngular/app/images/25-1.PNG differ diff --git a/quizAngular/app/images/25-2.PNG b/quizAngular/app/images/25-2.PNG new file mode 100755 index 0000000..f5ddef0 Binary files /dev/null and b/quizAngular/app/images/25-2.PNG differ diff --git a/quizAngular/app/images/25-3.PNG b/quizAngular/app/images/25-3.PNG new file mode 100755 index 0000000..069326e Binary files /dev/null and b/quizAngular/app/images/25-3.PNG differ diff --git a/quizAngular/app/images/25-4.PNG b/quizAngular/app/images/25-4.PNG new file mode 100755 index 0000000..0289c44 Binary files /dev/null and b/quizAngular/app/images/25-4.PNG differ diff --git a/quizAngular/app/images/25-5.PNG b/quizAngular/app/images/25-5.PNG new file mode 100755 index 0000000..4a3b09e Binary files /dev/null and b/quizAngular/app/images/25-5.PNG differ diff --git a/quizAngular/app/images/25-6.PNG b/quizAngular/app/images/25-6.PNG new file mode 100755 index 0000000..8a7edac Binary files /dev/null and b/quizAngular/app/images/25-6.PNG differ diff --git a/quizAngular/app/images/25-7.PNG b/quizAngular/app/images/25-7.PNG new file mode 100755 index 0000000..d6ca53a Binary files /dev/null and b/quizAngular/app/images/25-7.PNG differ diff --git a/quizAngular/app/images/3.PNG b/quizAngular/app/images/3.PNG new file mode 100755 index 0000000..2bb0f30 Binary files /dev/null and b/quizAngular/app/images/3.PNG differ diff --git a/quizAngular/app/images/4.PNG b/quizAngular/app/images/4.PNG new file mode 100755 index 0000000..64c379b Binary files /dev/null and b/quizAngular/app/images/4.PNG differ diff --git a/quizAngular/app/images/6.PNG b/quizAngular/app/images/6.PNG new file mode 100755 index 0000000..f2c469e Binary files /dev/null and b/quizAngular/app/images/6.PNG differ diff --git a/quizAngular/app/images/yeoman.png b/quizAngular/app/images/yeoman.png new file mode 100755 index 0000000..92497ad Binary files /dev/null and b/quizAngular/app/images/yeoman.png differ diff --git a/quizAngular/app/index.html b/quizAngular/app/index.html new file mode 100755 index 0000000..c4d4f32 --- /dev/null +++ b/quizAngular/app/index.html @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + +
+
+

IPRO 207 Interactive ExercisesFrom Physical Ball and Stick to Computer Models of Chemical Systems

+
+ + +
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quizAngular/app/robots.txt b/quizAngular/app/robots.txt new file mode 100755 index 0000000..9417495 --- /dev/null +++ b/quizAngular/app/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org + +User-agent: * diff --git a/quizAngular/app/scripts/app.js b/quizAngular/app/scripts/app.js new file mode 100755 index 0000000..9d4e96f --- /dev/null +++ b/quizAngular/app/scripts/app.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * @ngdoc overview + * @name quizAngularApp + * @description + * # quizAngularApp + * + * Main module of the application. + */ +angular + .module('quizAngularApp', [ + 'ngAnimate', + 'ngCookies', + 'ngResource', + 'ngRoute', + 'ngSanitize', + 'ngTouch' + ]) + .config(function ($routeProvider) { + $routeProvider + .when('/', { + templateUrl: 'views/main.html', + controller: 'MainCtrl' + }) + .when('/about', { + templateUrl: 'views/about.html', + controller: 'AboutCtrl' + }) + .otherwise({ + redirectTo: '/' + }); + }); diff --git a/quizAngular/app/scripts/controllers/about.js b/quizAngular/app/scripts/controllers/about.js new file mode 100755 index 0000000..53fedba --- /dev/null +++ b/quizAngular/app/scripts/controllers/about.js @@ -0,0 +1,17 @@ +'use strict'; + +/** + * @ngdoc function + * @name quizAngularApp.controller:AboutCtrl + * @description + * # AboutCtrl + * Controller of the quizAngularApp + */ +angular.module('quizAngularApp') + .controller('AboutCtrl', function ($scope) { + $scope.awesomeThings = [ + 'HTML5 Boilerplate', + 'AngularJS', + 'Karma' + ]; + }); diff --git a/quizAngular/app/scripts/controllers/main.js b/quizAngular/app/scripts/controllers/main.js new file mode 100755 index 0000000..99502ac --- /dev/null +++ b/quizAngular/app/scripts/controllers/main.js @@ -0,0 +1,897 @@ +'use strict'; + +/** + * @ngdoc function + * @name quizAngularApp.controller:MainCtrl + * @description + * # MainCtrl + * Controller of the quizAngularApp + */ + +var SMILES; +function quiz(quizFactory) { + return { + restrict: 'AE', + scope: {}, + templateUrl: 'views/template.html', + link: function(scope, elem, attrs) { + scope.start = function() { + scope.id = 0; + scope.quizOver = false; + scope.inProgress = true; + scope.getQuestion(); + }; + + scope.reset = function() { + scope.inProgress = false; + scope.score = 0; + }; + + scope.getQuestion = function() { + var q = quizFactory.getQuestion(scope.id); + var size = quizFactory.setSize; + if(q) { + scope.type = q.type; + scope.question = q.question; + scope.options = q.options; + scope.answer = q.answer; + scope.imgs = q.imgs; + scope.answerMode = true; + $('textarea').val(''); + $('input:radio:checked').prop('checked', false); + $('.progress-bar').css('width', scope.id/size*100+'%'); + } else { + scope.quizOver = true; + } + }; + + scope.checkAnswer = function() { + switch( scope.type ) { + case '0': + if(!$('input[name=answer]:checked').length) { + return; + } + var ans = $('input[name=answer]:checked').val(); + + if(ans === scope.options[scope.answer]) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '1': + var ans = $('textarea').val(); + if (!ans.length) {return;} + if (ans === scope.answer) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '3': + console.log('SMILES is'+SMILES); + if(!SMILES) {return;} + if(scope.answer === SMILES) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + } + + + scope.answerMode = false; + }; + + scope.nextQuestion = function() { + scope.id++; + scope.getQuestion(); + }; + + scope.reset(); + } + }; +} + +function quizFactory() { + var questions = [ + { + type: '0', + question: 'Select a correct IUPAC name for the structure below.', + options: ['2-iodo-4-ethyl-4-methylpentane', '3,3-dimethyl-5-iodohexane', '2-iodo-4,4-dimethylhexane', '2-ethyl-2-methyl-4-iodopentane'], + imgs:'1.PNG', + answer: 2 + }, + { + type: '0', + question: 'Select a correct IUPAC name for the structure below.', + options: ['1-ethyl-1-isopropylhexane', '2-methyl-3-ethyloctane', '3-ethyl-2-methyloctane', '2-methyl-3-pentylpentane'], + imgs:'2.PNG', + answer: 2 + }, + { + type: '0', + question: 'Select a correct IUPAC name for the structure below.', + options: ['2-methyl-3-ethylheptane', '3-butyl-2-methylpentane', '3-ethyl-2-methylheptane', '5-isopropylheptane'], + imgs:'3.PNG', + answer: 2 + }, + { + type: '1', + question: 'Name the following compound according to the IUPAC system', + options: [], + imgs:'4.PNG', + answer: '2-ethyl-1,1-dimethylcyclopropane' + }, + { + type: '1', + question: 'Name the following compound according to the IUPAC system', + options: [], + imgs: '6.PNG', + answer: '3-ethyl-2-methylpentane' + }, + { + type: '3', + question: 'Build ethanol.', + options: [], + imgs:'', + answer: 'CCO' + }, + { + type: '3', + question: 'Build 5-ethyl-2,3,4-trimethylheptane.', + options: [], + imgs:'', + answer: 'CCC(CC)C(C)C(C)C(C)C' + }, + { + type: '3', + question: 'Build 2-chlorobutane.', + options: [], + imgs:'', + answer: 'CCC(C)Cl' + }, + { + type: '3', + question: 'Build 2-ethylthiobutane.', + options: [], + imgs:'', + answer: 'CCSC(C)CC' + }, + { + type: '3', + question: 'Build 1-methoxybutane.', + options: [], + imgs:'', + answer: 'CCCCOC' + } + ]; + + return { + setSize: questions.length, + getQuestion: function(id) { + if(id < questions.length) { + return questions[id]; + } else { + return false; + } + } + }; +} +function quiz2(quizFactory2) { + return { + restrict: 'AE', + scope: {}, + templateUrl: 'views/template2.html', + link: function(scope, elem, attrs) { + scope.start = function() { + scope.id = 0; + scope.quizOver = false; + scope.inProgress = true; + scope.getQuestion(); + }; + + scope.reset = function() { + scope.inProgress = false; + scope.score = 0; + }; + + scope.getQuestion = function() { + var q = quizFactory2.getQuestion(scope.id); + var size = quizFactory2.setSize; + if(q) { + scope.type = q.type; + scope.question = q.question; + scope.options = q.options; + scope.answer = q.answer; + scope.imgs = q.imgs; + scope.answerMode = true; + $('textarea').val(''); + $('input:radio:checked').prop('checked', false); + $('.progress-bar').css('width', scope.id/size*100+'%'); + } else { + scope.quizOver = true; + } + }; + + scope.checkAnswer = function() { + switch( scope.type ) { + case '0': + if(!$('input[name=answer]:checked').length) { + return; + } + var ans = $('input[name=answer]:checked').val(); + if(ans === scope.options[scope.answer]) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '1': + var ans = $('textarea').val(); + if (!ans.length) {return;} + if (ans === scope.answer) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '3': + console.log('SMILES is'+SMILES); + if(!SMILES) {return;} + if(scope.answer === SMILES) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + } + + + scope.answerMode = false; + }; + + scope.nextQuestion = function() { + scope.id++; + scope.getQuestion(); + }; + + scope.reset(); + } + }; +} + +function quizFactory2() { + var questions = [ + { + type: '3', + question: 'Build water.', + options: [], + imgs:'', + answer: 'HOH' + }, + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-1.PNG', + answer: 0 + }, + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-2.PNG', + answer: 1 + }, + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-3.PNG', + answer: 0 + }, + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-4.PNG', + answer: 1 + }, + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-5.PNG', + answer: 0 + }, + + { + type: '0', + question: 'Select a correct configuration of the following molecule?', + options: ['S', 'R'], + imgs:'21-6.PNG', + answer: 1 + }, + { + type: '0', + question: 'Is the molecule chiral or achiral', + options: ['chiral', 'achiral'], + imgs:'22-1.PNG', + answer: 1 + }, + { + type: '0', + question: 'Is the molecule chiral or achiral', + options: ['chiral', 'achiral'], + imgs:'22-2.PNG', + answer: 1 + }, + { + type: '0', + question: 'Is the molecule chiral or achiral', + options: ['chiral', 'achiral'], + imgs:'22-3.PNG', + answer: 0 + }, + { + type: '0', + question: 'Is the molecule chiral or achiral', + options: ['chiral', 'achiral'], + imgs:'22-4.PNG', + answer: 1 + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-1.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-2.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-3.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-4.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-5.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-6.PNG', + answer: 'S' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-7.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-8.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-9.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-10.PNG', + answer: 'R' + }, + { + type: '1', + question: 'What is the configuration of the following molecule?', + options: [], + imgs: '20-11.PNG', + answer: 'R' + } + ]; + + return { + setSize: questions.length, + getQuestion: function(id) { + if(id < questions.length) { + return questions[id]; + } else { + return false; + } + } + }; +} + +function quiz3(quizFactory3) { + return { + restrict: 'AE', + scope: {}, + templateUrl: 'views/template3.html', + link: function(scope, elem, attrs) { + scope.start = function() { + scope.id = 0; + scope.quizOver = false; + scope.inProgress = true; + scope.getQuestion(); + }; + + scope.reset = function() { + scope.inProgress = false; + scope.score = 0; + }; + + scope.getQuestion = function() { + var q = quizFactory3.getQuestion(scope.id); + var size = quizFactory3.setSize; + if(q) { + scope.type = q.type; + scope.question = q.question; + scope.options = q.options; + scope.answer = q.answer; + scope.imgs = q.imgs; + scope.answerMode = true; + $('textarea').val(''); + $('input:radio:checked').prop('checked', false); + $('.progress-bar').css('width', scope.id/size*100+'%'); + } else { + scope.quizOver = true; + } + }; + + scope.checkAnswer = function() { + switch( scope.type ) { + case '0': + if(!$('input[name=answer]:checked').length) { + return; + } + var ans = $('input[name=answer]:checked').val(); + + if(ans === scope.options[scope.answer]) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '1': + var ans = $('textarea').val(); + if (!ans.length) {return;} + if (ans === scope.answer) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '3': + console.log('SMILES is'+SMILES); + if(!SMILES) {return;} + if(scope.answer === SMILES) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + } + + + scope.answerMode = false; + }; + + scope.nextQuestion = function() { + scope.id++; + scope.getQuestion(); + }; + + scope.reset(); + } + }; +} + +function quizFactory3() { + var questions = [ + { + type: '0', + question: "Which is the best reaction sequence to use if one wants to accomplish an alcohol synthesis shown? ", + options: ["NaOH/H2O", " KMnO4/H2O", " i) Hg(OAc)2/H2O; ii) NaBH4", " i) BH3; ii)H2O2/HO"], + imgs:'10.PNG', + answer: 2 + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-1.PNG', + answer: 'CH3CH2CH=CH2' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-2.PNG', + answer: 'CH3CH2CH2CH2PCH3' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-3.PNG', + answer: 'SCH2CH3' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-4.PNG', + answer: 'CCC(CC)C(C)C(C)C(C)C' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-5.PNG', + answer: 'CCC(CC)C(C)C(C)C(C)C' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-6.PNG', + answer: 'CCC(CC)C(C)C(C)C(C)C' + }, + { + type: '3', + question: "Build the result of the reaction sequence shown?", + options: [], + imgs:'25-7.PNG', + answer: 'CCC(CC)C(C)C(C)C(C)C' + }, + { + type: '0', + question: "Which is the best reaction sequence to use if one wants to accomplish the synthesis shown?", + options: ["KMnO4/H2O", "Hg(OAc)2/H2O; ii) NaBH4", " i) KOC(CH3)3; ii) (CH3)3COH", " i) BH3; ii)H2O2/HO"], + imgs:'12.PNG', + answer: 2 + } + ]; + + return { + setSize: questions.length, + getQuestion: function(id) { + if(id < questions.length) { + return questions[id]; + } else { + return false; + } + } + }; +} + +function quiz4(quizFactory4) { + return { + restrict: 'AE', + scope: {}, + templateUrl: 'views/template4.html', + link: function(scope, elem, attrs) { + scope.start = function() { + scope.id = 0; + scope.quizOver = false; + scope.inProgress = true; + scope.getQuestion(); + }; + + scope.reset = function() { + scope.inProgress = false; + scope.score = 0; + }; + + scope.getQuestion = function() { + var q = quizFactory4.getQuestion(scope.id); + var size = quizFactory4.setSize; + if(q) { + scope.type = q.type; + scope.question = q.question; + scope.options = q.options; + scope.answer = q.answer; + scope.imgs = q.imgs; + scope.answerMode = true; + $('textarea').val(''); + $('input:radio:checked').prop('checked', false); + $('.progress-bar').css('width', scope.id/size*100+'%'); + } else { + scope.quizOver = true; + } + }; + + scope.checkAnswer = function() { + switch( scope.type ) { + case '0': + if(!$('input[name=answer]:checked').length) { + return; + } + var ans = $('input[name=answer]:checked').val(); + + if(ans === scope.options[scope.answer]) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '1': + var ans = $('textarea').val(); + if (!ans.length) {return;} + if (ans === scope.answer) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + case '3': + console.log('SMILES is'+SMILES); + if(!SMILES) {return;} + if(scope.answer === SMILES) { + scope.score++; + scope.correctAns = true; + } else { + scope.correctAns = false; + } + break; + } + + + scope.answerMode = false; + }; + + scope.nextQuestion = function() { + scope.id++; + scope.getQuestion(); + }; + + scope.reset(); + } + }; +} + +function quizFactory4() { + var questions = [ + { + type: '3', + question: "Build the molecule that does NOT contain carbon atoms: A) Water B) Propane C) Carbonite ", + options: [], + imgs:'', + answer: '', + hint:"hint", + }, + { + type: '3', + question: "Build a Dihydrogen Monoxide molecule.", + options: [], + imgs:'', + answer: 'DHMO', + hint:"hint", + }, + { + type: '3', + question: "A Cyclohexane molecule consists of 6 carbons that form a hexagon shape. Build a Cyclopentane molecule.", + options: [], + imgs:'', + answer: 'C1CCCCC1', + hint:"hint", + }, + { + type: '3', + question: "Build the molecule that is an alcohol: A) Ethane B)Ethene C)Ethanol (pictures shown?)", + options: [], + imgs:'', + answer: '', + hint:"hint", + }, + { + type: '3', + question: "Build the molecule that is an alkane: A) Ethane B)Ethene C)Ethanol (pictures shown?)", + options: [], + imgs:'', + answer: '', + hint:"hint", + }, + { + type: '3', + question: "Build a Carbon Dioxide molecule (Assume single bond piece represents double bond)", + options: [], + imgs:'', + answer: 'CO2', + hint:"hint", + }, + { + type: '3', + question: "Build a Hydrogen Peroxide molecule.", + options: [], + imgs:'', + answer: 'H2O2', + hint:"hint", + }, + { + type: '3', + question: "Build an Octane molecule.", + options: [], + imgs:'', + answer: 'C8H18', + hint:"hint", + }, + { + type: '3', + question: "Build a Hydrogen Molecule.", + options: [], + imgs:'', + answer: 'H', + hint:"hint", + }, + { + type: '3', + question: "2 molecules of H2O were formed by combining 2 molecules of H2 and 1 molecule of X. Build this molecule.", + options: [], + imgs:'', + answer: 'CCC(CC)C(C)C(C)C(C)C', + hint:"hint", + } + ]; + + return { + setSize: questions.length, + getQuestion: function(id) { + if(id < questions.length) { + return questions[id]; + } else { + return false; + } + } + }; +} + + +angular.module('quizAngularApp') + .directive('quiz', quiz) + .directive('quiz2', quiz2) + .directive('quiz3', quiz3) + .directive('quiz4', quiz4) + .factory('quizFactory', quizFactory) + .factory('quizFactory2', quizFactory2) + .factory('quizFactory3', quizFactory3) + .factory('quizFactory4', quizFactory4) + .controller('MainCtrl', function ($scope) { + $scope.awesomeThings = [ + 'HTML5 Boilerplate', + 'AngularJS', + 'Karma' + ]; + }); + + +$('#start').on('click', + function(){ + var mediaOptions = { audio: false, video: true }; + + if (!navigator.getUserMedia) { + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; + } + + if (!navigator.getUserMedia){ + return alert('getUserMedia not supported in this browser.'); + } + + function success(stream){ + var video = document.querySelector('#player'); + video.src = window.URL.createObjectURL(stream); + } + + navigator.getUserMedia(mediaOptions, success, function(e) { + console.log(e); + }); + + + }); + + + +var start = function() { + //Compatibility + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; + + var canvas = document.getElementById('canvas'), + context = canvas.getContext('2d'), + video = document.getElementById('video'), + btnRecord = document.getElementById('btnRecord'), + btnPhoto = document.getElementById('btnPhoto'), + btnStop = document.getElementById('btnStop'), + videoObj = { + video: true, + audio: false + }; + $('#btnStart').prop('disabled', true); + + btnRecord.addEventListener('click', function() { + var localMediaStream; + + if (navigator.getUserMedia) { + navigator.getUserMedia(videoObj, function(stream) { + video.src = (navigator.webkitGetUserMedia) ? window.URL.createObjectURL(stream) : stream; + localMediaStream = stream; + + }, function(error) { + console.error('Video capture error: ', error.code); + }); + + btnStop.addEventListener('click', function() { + localMediaStream.getVideoTracks()[0].stop(); + }); + + btnPhoto.addEventListener('click', function() { + context.drawImage(video, 0, 0, 640, 480); + var data = canvas.toDataURL('image/PNG', 1.0), array = []; + data = atob(data.split(',')[1]); + for (var i=0; i hr { + margin: 30px 0; +} + +.nav { + font-size: 1.5em; +} + +.nav li a { + color:rgb(128, 128, 128); +} + +.intro { + width:700px; + /*border:1px solid gray; + border-radius:10px;*/ + position:relative; + margin:5% auto auto auto; + background-color:#ffff; + padding:50px 60px 100px 60px; + font-size: 1.5em; + min-height:450px; +} + +.quizArea { + width:700px; + /*border:1px solid gray; + border-radius:10px;*/ + position:relative; + margin:5% auto auto auto; + background-color:#ffff; + padding:50px 60px 100px 60px; + font-size: 1.5em; + min-height:450px; +} + +li { + list-style:none; +} + +#options { + margin: 10px 0; +} + +.next-question { + margin-right:10px; +} + +.btn { + float:right; + cursor:pointer; + } + +#tab-content { + min-height:500px; +} + +#video { + width: 250px; + height: 180px; +} + + + +article { + width: 80%; + margin: auto; + margin-top: 20px; +} + +/* Main marketing message and sign up button */ +.jumbotron { + text-align: center; + border-bottom: 1px solid #e5e5e5; + min-height: 200px; + text-align: left; + vertical-align: center; + padding: 5em 5em; + letter-spacing: -1px; +} +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} +.jumbotron h1 { + max-width: 1200px; + margin: 0 auto; + font-weight: 800; + font-size: 5em; + line-height: 1; + } +.jumbotron h1 span { + display: block; + font-size: 50%; + font-weight: 400; + padding-top: 0.325em; + color: #bdc2c9; +} + +.progress-bar { + background-image: none; + background-color: rgb(129, 129, 129); +} + +ol li.list-group-item { + list-style: decimal inside; + display: list-item; +} + +/* Supporting marketing content */ +.marketing { + margin: 40px 0; +} +.marketing p + h4 { + margin-top: 28px; +} + +/* Responsive: Portrait tablets and up */ +@media screen and (min-width: 768px) { + .container { + max-width: 730px; + } + + /* Remove the padding we set earlier */ + .header, + .marketing, + .footer { + padding-left: 0; + padding-right: 0; + } + /* Space out the masthead */ + .header { + margin-bottom: 30px; + } + /* Remove the bottom border on the jumbotron for visual effect */ + .jumbotron { + border-bottom: 0; + } + + +} diff --git a/quizAngular/app/views/about.html b/quizAngular/app/views/about.html new file mode 100755 index 0000000..d21bf89 --- /dev/null +++ b/quizAngular/app/views/about.html @@ -0,0 +1 @@ +

This is the about view.

diff --git a/quizAngular/app/views/main.html b/quizAngular/app/views/main.html new file mode 100755 index 0000000..e69de29 diff --git a/quizAngular/app/views/template.html b/quizAngular/app/views/template.html new file mode 100755 index 0000000..1b8e943 --- /dev/null +++ b/quizAngular/app/views/template.html @@ -0,0 +1,89 @@ +
+
+
+
+
+
+
+
+
+
+

{{question}}

+
+
    +
  • + +
  • +
+
+ +
+ +
+
+ +
+
+
+
Instructions
+
    +
  1. Start playing by clicking . The button will be disabled after being activated only once.
  2. +
  3. Start the web camera stream by clicking .
  4. +
  5. Capture a picture and submit the picture to server that can detect the model you built by clicking .
  6. +
  7. In case that you want to stop the web cam stream, click .
  8. +
  9. Submit the result as usual once you are confident with the result.
  10. +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + +
+ + +
+
+ +
+ +
+ + Correct! + Incorrect :( +
+
+
+ +
+

Quiz is over. Score: {{score}}

+ +
+ +
+ +
+

Nomenclature

+
+

This series of questions will help you review nomenclature of organic molecules. Apart from traditional exercise questions, you will be building several molecules based on their name using the modelling kit.

+
+
+ Begin! +
+ diff --git a/quizAngular/app/views/template2.html b/quizAngular/app/views/template2.html new file mode 100755 index 0000000..57e3eac --- /dev/null +++ b/quizAngular/app/views/template2.html @@ -0,0 +1,88 @@ +
+
+
+
+
+
+
+
+
+
+

{{question}}

+

{{hint}}

+
+
    +
  • + +
  • +
+
+ +
+ +
+
+ +
+
+
+
Instructions
+
    +
  1. Start playing by clicking . The button will be disabled after being activated only once.
  2. +
  3. Start the web camera stream by clicking .
  4. +
  5. Capture a picture and submit the picture to server that can detect the model you built by clicking .
  6. +
  7. In case that you want to stop the web cam stream, click .
  8. +
  9. Submit the result as usual once you are confident with the result.
  10. +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + +
+ + +
+
+ +
+ +
+ + Correct! + Incorrect :( +
+
+
+ +
+

Quiz is over. Score: {{score}}

+ +
+ +
+ +
+

Stereochemistry

+
+

Stereochemistry, a subdiscipline of chemistry, involves the study of the relative spatial arrangement of atoms that form the structure of molecules and their manipulation. An important branch of stereochemistry is the study of chiral molecules.

+
+
+ Begin! +
\ No newline at end of file diff --git a/quizAngular/app/views/template3.html b/quizAngular/app/views/template3.html new file mode 100755 index 0000000..f9b5f74 --- /dev/null +++ b/quizAngular/app/views/template3.html @@ -0,0 +1,102 @@ + +
+
+
+
+
+
+
+
+
+
+

{{question}}

+

{{hint}}

+
+
    +
  • + +
  • +
+
+ +
+ +
+
+ +
+
+ +
+
Instructions
+
    +
  1. Start playing by clicking . The button will be disabled after being activated only once.
  2. +
  3. Start the web camera stream by clicking .
  4. +
  5. Capture a picture and submit the picture to server that can detect the model you built by clicking .
  6. +
  7. In case that you want to stop the web cam stream, click .
  8. +
  9. Submit the result as usual once you are confident with the result.
  10. +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + +
+ + +
+
+ +
+ +
+ + Correct! + Incorrect :( +
+
+
+ +
+

Quiz is over. Score: {{score}}

+ +
+ +
+ +
+

Reactions

+
+

A chemical reaction is when a substance (or a few substances) change into another substance. Chemical reactions are chemical transformations. If you take a chemistry class, you'll definitely learn about chemical reactions: when one or more substances change into something else. Get tested on your knowledge of reactions.

+
+
+ Begin! +
\ No newline at end of file diff --git a/quizAngular/app/views/template4.html b/quizAngular/app/views/template4.html new file mode 100755 index 0000000..8e38cbe --- /dev/null +++ b/quizAngular/app/views/template4.html @@ -0,0 +1,102 @@ + +
+
+
+
+
+
+
+
+
+
+

{{question}}

+

{{hint}}

+
+
    +
  • + +
  • +
+
+ +
+ +
+
+ +
+
+
+
Instructions
+
    +
  1. Start playing by clicking . The button will be disabled after being activated only once.
  2. +
  3. Start the web camera stream by clicking .
  4. +
  5. Capture a picture and submit the picture to server that can detect the model you built by clicking .
  6. +
  7. In case that you want to stop the web cam stream, click .
  8. +
  9. Submit the result as usual once you are confident with the result.
  10. +
+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + +
+ + +
+
+ +
+ +
+ + Correct! + Incorrect :( +
+
+
+ +
+

Quiz is over. Score: {{score}}

+ +
+ +
+ +
+

Easy Quiz

+
+

A collection of easy quiz to get started with!

+
+
+ Begin! +
\ No newline at end of file diff --git a/quizAngular/bower.json b/quizAngular/bower.json new file mode 100755 index 0000000..f8586ff --- /dev/null +++ b/quizAngular/bower.json @@ -0,0 +1,28 @@ +{ + "name": "quiz-angular", + "version": "0.0.0", + "dependencies": { + "angular": "^1.3.0", + "bootstrap": "^3.2.0", + "angular-animate": "^1.3.0", + "angular-cookies": "^1.3.0", + "angular-resource": "^1.3.0", + "angular-route": "^1.3.0", + "angular-sanitize": "^1.3.0", + "angular-touch": "^1.3.0" + }, + "devDependencies": { + "angular-mocks": "^1.3.0" + }, + "overrides": { + "bootstrap": { + "main": [ + "dist/js/bootstrap.js", + "dist/css/bootstrap.css", + "less/bootstrap.less" + ] + } + }, + "appPath": "app", + "moduleName": "quizAngularApp" +} diff --git a/quizAngular/dist/.htaccess b/quizAngular/dist/.htaccess new file mode 100755 index 0000000..cb84cb9 --- /dev/null +++ b/quizAngular/dist/.htaccess @@ -0,0 +1,543 @@ +# Apache Configuration File + +# (!) Using `.htaccess` files slows down Apache, therefore, if you have access +# to the main server config file (usually called `httpd.conf`), you should add +# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html. + +# ############################################################################## +# # CROSS-ORIGIN RESOURCE SHARING (CORS) # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Cross-domain AJAX requests | +# ------------------------------------------------------------------------------ + +# Enable cross-origin AJAX requests. +# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity +# http://enable-cors.org/ + +# +# Header set Access-Control-Allow-Origin "*" +# + +# ------------------------------------------------------------------------------ +# | CORS-enabled images | +# ------------------------------------------------------------------------------ + +# Send the CORS header for images when browsers request it. +# https://developer.mozilla.org/en/CORS_Enabled_Image +# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html +# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ + + + + + SetEnvIf Origin ":" IS_CORS + Header set Access-Control-Allow-Origin "*" env=IS_CORS + + + + +# ------------------------------------------------------------------------------ +# | Web fonts access | +# ------------------------------------------------------------------------------ + +# Allow access from all domains for web fonts + + + + Header set Access-Control-Allow-Origin "*" + + + + +# ############################################################################## +# # ERRORS # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | 404 error prevention for non-existing redirected folders | +# ------------------------------------------------------------------------------ + +# Prevent Apache from returning a 404 error for a rewrite if a directory +# with the same name does not exist. +# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews +# http://www.webmasterworld.com/apache/3808792.htm + +Options -MultiViews + +# ------------------------------------------------------------------------------ +# | Custom error messages / pages | +# ------------------------------------------------------------------------------ + +# You can customize what Apache returns to the client in case of an error (see +# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.: + +ErrorDocument 404 /404.html + + +# ############################################################################## +# # INTERNET EXPLORER # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Better website experience | +# ------------------------------------------------------------------------------ + +# Force IE to render pages in the highest available mode in the various +# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf. + + + Header set X-UA-Compatible "IE=edge" + # `mod_headers` can't match based on the content-type, however, we only + # want to send this header for HTML pages and not for the other resources + + Header unset X-UA-Compatible + + + +# ------------------------------------------------------------------------------ +# | Cookie setting from iframes | +# ------------------------------------------------------------------------------ + +# Allow cookies to be set from iframes in IE. + +# +# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"" +# + +# ------------------------------------------------------------------------------ +# | Screen flicker | +# ------------------------------------------------------------------------------ + +# Stop screen flicker in IE on CSS rollovers (this only works in +# combination with the `ExpiresByType` directives for images from below). + +# BrowserMatch "MSIE" brokenvary=1 +# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 +# BrowserMatch "Opera" !brokenvary +# SetEnvIf brokenvary 1 force-no-vary + + +# ############################################################################## +# # MIME TYPES AND ENCODING # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Proper MIME types for all files | +# ------------------------------------------------------------------------------ + + + + # Audio + AddType audio/mp4 m4a f4a f4b + AddType audio/ogg oga ogg + + # JavaScript + # Normalize to standard type (it's sniffed in IE anyways): + # http://tools.ietf.org/html/rfc4329#section-7.2 + AddType application/javascript js jsonp + AddType application/json json + + # Video + AddType video/mp4 mp4 m4v f4v f4p + AddType video/ogg ogv + AddType video/webm webm + AddType video/x-flv flv + + # Web fonts + AddType application/font-woff woff + AddType application/vnd.ms-fontobject eot + + # Browsers usually ignore the font MIME types and sniff the content, + # however, Chrome shows a warning if other MIME types are used for the + # following fonts. + AddType application/x-font-ttf ttc ttf + AddType font/opentype otf + + # Make SVGZ fonts work on iPad: + # https://twitter.com/FontSquirrel/status/14855840545 + AddType image/svg+xml svg svgz + AddEncoding gzip svgz + + # Other + AddType application/octet-stream safariextz + AddType application/x-chrome-extension crx + AddType application/x-opera-extension oex + AddType application/x-shockwave-flash swf + AddType application/x-web-app-manifest+json webapp + AddType application/x-xpinstall xpi + AddType application/xml atom rdf rss xml + AddType image/webp webp + AddType image/x-icon ico + AddType text/cache-manifest appcache manifest + AddType text/vtt vtt + AddType text/x-component htc + AddType text/x-vcard vcf + + + +# ------------------------------------------------------------------------------ +# | UTF-8 encoding | +# ------------------------------------------------------------------------------ + +# Use UTF-8 encoding for anything served as `text/html` or `text/plain`. +AddDefaultCharset utf-8 + +# Force UTF-8 for certain file formats. + + AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml + + + +# ############################################################################## +# # URL REWRITES # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Rewrite engine | +# ------------------------------------------------------------------------------ + +# Turning on the rewrite engine and enabling the `FollowSymLinks` option is +# necessary for the following directives to work. + +# If your web host doesn't allow the `FollowSymlinks` option, you may need to +# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the +# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks + +# Also, some cloud hosting services require `RewriteBase` to be set: +# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site + + + Options +FollowSymlinks + # Options +SymLinksIfOwnerMatch + RewriteEngine On + # RewriteBase / + + +# ------------------------------------------------------------------------------ +# | Suppressing / Forcing the "www." at the beginning of URLs | +# ------------------------------------------------------------------------------ + +# The same content should never be available under two different URLs especially +# not with and without "www." at the beginning. This can cause SEO problems +# (duplicate content), therefore, you should choose one of the alternatives and +# redirect the other one. + +# By default option 1 (no "www.") is activated: +# http://no-www.org/faq.php?q=class_b + +# If you'd prefer to use option 2, just comment out all the lines from option 1 +# and uncomment the ones from option 2. + +# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME! + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Option 1: rewrite www.example.com → example.com + + + RewriteCond %{HTTPS} !=on + RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] + RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Option 2: rewrite example.com → www.example.com + +# Be aware that the following might not be a good idea if you use "real" +# subdomains for certain parts of your website. + +# +# RewriteCond %{HTTPS} !=on +# RewriteCond %{HTTP_HOST} !^www\..+$ [NC] +# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] +# + + +# ############################################################################## +# # SECURITY # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Content Security Policy (CSP) | +# ------------------------------------------------------------------------------ + +# You can mitigate the risk of cross-site scripting and other content-injection +# attacks by setting a Content Security Policy which whitelists trusted sources +# of content for your site. + +# The example header below allows ONLY scripts that are loaded from the current +# site's origin (no inline scripts, no CDN, etc). This almost certainly won't +# work as-is for your site! + +# To get all the details you'll need to craft a reasonable policy for your site, +# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or +# see the specification: http://w3.org/TR/CSP). + +# +# Header set Content-Security-Policy "script-src 'self'; object-src 'self'" +# +# Header unset Content-Security-Policy +# +# + +# ------------------------------------------------------------------------------ +# | File access | +# ------------------------------------------------------------------------------ + +# Block access to directories without a default document. +# Usually you should leave this uncommented because you shouldn't allow anyone +# to surf through every directory on your server (which may includes rather +# private places like the CMS's directories). + + + Options -Indexes + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Block access to hidden files and directories. +# This includes directories used by version control systems such as Git and SVN. + + + RewriteCond %{SCRIPT_FILENAME} -d [OR] + RewriteCond %{SCRIPT_FILENAME} -f + RewriteRule "(^|/)\." - [F] + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Block access to backup and source files. +# These files may be left by some text editors and can pose a great security +# danger when anyone has access to them. + + + Order allow,deny + Deny from all + Satisfy All + + +# ------------------------------------------------------------------------------ +# | Secure Sockets Layer (SSL) | +# ------------------------------------------------------------------------------ + +# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.: +# prevent `https://www.example.com` when your certificate only allows +# `https://secure.example.com`. + +# +# RewriteCond %{SERVER_PORT} !^443 +# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L] +# + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Force client-side SSL redirection. + +# If a user types "example.com" in his browser, the above rule will redirect him +# to the secure version of the site. That still leaves a window of opportunity +# (the initial HTTP connection) for an attacker to downgrade or redirect the +# request. The following header ensures that browser will ONLY connect to your +# server via HTTPS, regardless of what the users type in the address bar. +# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/ + +# +# Header set Strict-Transport-Security max-age=16070400; +# + +# ------------------------------------------------------------------------------ +# | Server software information | +# ------------------------------------------------------------------------------ + +# Avoid displaying the exact Apache version number, the description of the +# generic OS-type and the information about Apache's compiled-in modules. + +# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`! + +# ServerTokens Prod + + +# ############################################################################## +# # WEB PERFORMANCE # +# ############################################################################## + +# ------------------------------------------------------------------------------ +# | Compression | +# ------------------------------------------------------------------------------ + + + + # Force compression for mangled headers. + # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # Compress all output labeled with one of the following MIME-types + # (for Apache versions below 2.3.7, you don't need to enable `mod_filter` + # and can remove the `` and `` lines + # as `AddOutputFilterByType` is still in the core directives). + + AddOutputFilterByType DEFLATE application/atom+xml \ + application/javascript \ + application/json \ + application/rss+xml \ + application/vnd.ms-fontobject \ + application/x-font-ttf \ + application/x-web-app-manifest+json \ + application/xhtml+xml \ + application/xml \ + font/opentype \ + image/svg+xml \ + image/x-icon \ + text/css \ + text/html \ + text/plain \ + text/x-component \ + text/xml + + + + +# ------------------------------------------------------------------------------ +# | Content transformations | +# ------------------------------------------------------------------------------ + +# Prevent some of the mobile network providers from modifying the content of +# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5. + +# +# Header set Cache-Control "no-transform" +# + +# ------------------------------------------------------------------------------ +# | ETag removal | +# ------------------------------------------------------------------------------ + +# Since we're sending far-future expires headers (see below), ETags can +# be removed: http://developer.yahoo.com/performance/rules.html#etags. + +# `FileETag None` is not enough for every server. + + Header unset ETag + + +FileETag None + +# ------------------------------------------------------------------------------ +# | Expires headers (for better cache control) | +# ------------------------------------------------------------------------------ + +# The following expires headers are set pretty far in the future. If you don't +# control versioning with filename-based cache busting, consider lowering the +# cache time for resources like CSS and JS to something like 1 week. + + + + ExpiresActive on + ExpiresDefault "access plus 1 month" + + # CSS + ExpiresByType text/css "access plus 1 year" + + # Data interchange + ExpiresByType application/json "access plus 0 seconds" + ExpiresByType application/xml "access plus 0 seconds" + ExpiresByType text/xml "access plus 0 seconds" + + # Favicon (cannot be renamed!) + ExpiresByType image/x-icon "access plus 1 week" + + # HTML components (HTCs) + ExpiresByType text/x-component "access plus 1 month" + + # HTML + ExpiresByType text/html "access plus 0 seconds" + + # JavaScript + ExpiresByType application/javascript "access plus 1 year" + + # Manifest files + ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" + ExpiresByType text/cache-manifest "access plus 0 seconds" + + # Media + ExpiresByType audio/ogg "access plus 1 month" + ExpiresByType image/gif "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType video/mp4 "access plus 1 month" + ExpiresByType video/ogg "access plus 1 month" + ExpiresByType video/webm "access plus 1 month" + + # Web feeds + ExpiresByType application/atom+xml "access plus 1 hour" + ExpiresByType application/rss+xml "access plus 1 hour" + + # Web fonts + ExpiresByType application/font-woff "access plus 1 month" + ExpiresByType application/vnd.ms-fontobject "access plus 1 month" + ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/opentype "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + + + +# ------------------------------------------------------------------------------ +# | Filename-based cache busting | +# ------------------------------------------------------------------------------ + +# If you're not using a build process to manage your filename version revving, +# you might want to consider enabling the following directives to route all +# requests such as `/css/style.12345.css` to `/css/style.css`. + +# To understand why this is important and a better idea than `*.css?v231`, read: +# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring + +# +# RewriteCond %{REQUEST_FILENAME} !-f +# RewriteCond %{REQUEST_FILENAME} !-d +# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] +# + +# ------------------------------------------------------------------------------ +# | File concatenation | +# ------------------------------------------------------------------------------ + +# Allow concatenation from within specific CSS and JS files, e.g.: +# Inside of `script.combined.js` you could have +# +# +# and they would be included into this single file. + +# +# +# Options +Includes +# AddOutputFilterByType INCLUDES application/javascript application/json +# SetOutputFilter INCLUDES +# +# +# Options +Includes +# AddOutputFilterByType INCLUDES text/css +# SetOutputFilter INCLUDES +# +# + +# ------------------------------------------------------------------------------ +# | Persistent connections | +# ------------------------------------------------------------------------------ + +# Allow multiple requests to be sent over the same TCP connection: +# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive. + +# Enable if you serve a lot of static content but, be aware of the +# possible disadvantages! + +# +# Header set Connection Keep-Alive +# diff --git a/quizAngular/dist/404.html b/quizAngular/dist/404.html new file mode 100755 index 0000000..a4bab4c --- /dev/null +++ b/quizAngular/dist/404.html @@ -0,0 +1,133 @@ + Page Not Found :(

Not found :(

Sorry, but the page you were trying to view does not exist.

It looks like this was the result of either:

  • a mistyped address
  • an out-of-date link
\ No newline at end of file diff --git a/quizAngular/dist/favicon (1).ico b/quizAngular/dist/favicon (1).ico new file mode 100755 index 0000000..af1b65b Binary files /dev/null and b/quizAngular/dist/favicon (1).ico differ diff --git a/quizAngular/dist/fonts/glyphicons-halflings-regular.eot b/quizAngular/dist/fonts/glyphicons-halflings-regular.eot new file mode 100755 index 0000000..b93a495 Binary files /dev/null and b/quizAngular/dist/fonts/glyphicons-halflings-regular.eot differ diff --git a/quizAngular/dist/fonts/glyphicons-halflings-regular.svg b/quizAngular/dist/fonts/glyphicons-halflings-regular.svg new file mode 100755 index 0000000..94fb549 --- /dev/null +++ b/quizAngular/dist/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quizAngular/dist/fonts/glyphicons-halflings-regular.ttf b/quizAngular/dist/fonts/glyphicons-halflings-regular.ttf new file mode 100755 index 0000000..1413fc6 Binary files /dev/null and b/quizAngular/dist/fonts/glyphicons-halflings-regular.ttf differ diff --git a/quizAngular/dist/fonts/glyphicons-halflings-regular.woff b/quizAngular/dist/fonts/glyphicons-halflings-regular.woff new file mode 100755 index 0000000..9e61285 Binary files /dev/null and b/quizAngular/dist/fonts/glyphicons-halflings-regular.woff differ diff --git a/quizAngular/dist/fonts/glyphicons-halflings-regular.woff2 b/quizAngular/dist/fonts/glyphicons-halflings-regular.woff2 new file mode 100755 index 0000000..64539b5 Binary files /dev/null and b/quizAngular/dist/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/quizAngular/dist/images/1.PNG b/quizAngular/dist/images/1.PNG new file mode 100755 index 0000000..ee2b827 Binary files /dev/null and b/quizAngular/dist/images/1.PNG differ diff --git a/quizAngular/dist/images/10.PNG b/quizAngular/dist/images/10.PNG new file mode 100755 index 0000000..502aaab Binary files /dev/null and b/quizAngular/dist/images/10.PNG differ diff --git a/quizAngular/dist/images/11-1.PNG b/quizAngular/dist/images/11-1.PNG new file mode 100755 index 0000000..af3066a Binary files /dev/null and b/quizAngular/dist/images/11-1.PNG differ diff --git a/quizAngular/dist/images/11.PNG b/quizAngular/dist/images/11.PNG new file mode 100755 index 0000000..cbfdb15 Binary files /dev/null and b/quizAngular/dist/images/11.PNG differ diff --git a/quizAngular/dist/images/12.PNG b/quizAngular/dist/images/12.PNG new file mode 100755 index 0000000..e0217bd Binary files /dev/null and b/quizAngular/dist/images/12.PNG differ diff --git a/quizAngular/dist/images/13.PNG b/quizAngular/dist/images/13.PNG new file mode 100755 index 0000000..e7966c9 Binary files /dev/null and b/quizAngular/dist/images/13.PNG differ diff --git a/quizAngular/dist/images/14.PNG b/quizAngular/dist/images/14.PNG new file mode 100755 index 0000000..e37929d Binary files /dev/null and b/quizAngular/dist/images/14.PNG differ diff --git a/quizAngular/dist/images/15.PNG b/quizAngular/dist/images/15.PNG new file mode 100755 index 0000000..dd23ee3 Binary files /dev/null and b/quizAngular/dist/images/15.PNG differ diff --git a/quizAngular/dist/images/16.PNG b/quizAngular/dist/images/16.PNG new file mode 100755 index 0000000..aaf2b48 Binary files /dev/null and b/quizAngular/dist/images/16.PNG differ diff --git a/quizAngular/dist/images/17.PNG b/quizAngular/dist/images/17.PNG new file mode 100755 index 0000000..5c66382 Binary files /dev/null and b/quizAngular/dist/images/17.PNG differ diff --git a/quizAngular/dist/images/18.PNG b/quizAngular/dist/images/18.PNG new file mode 100755 index 0000000..929af52 Binary files /dev/null and b/quizAngular/dist/images/18.PNG differ diff --git a/quizAngular/dist/images/19.PNG b/quizAngular/dist/images/19.PNG new file mode 100755 index 0000000..e0a44eb Binary files /dev/null and b/quizAngular/dist/images/19.PNG differ diff --git a/quizAngular/dist/images/2.PNG b/quizAngular/dist/images/2.PNG new file mode 100755 index 0000000..38832f8 Binary files /dev/null and b/quizAngular/dist/images/2.PNG differ diff --git a/quizAngular/dist/images/20-1.PNG b/quizAngular/dist/images/20-1.PNG new file mode 100755 index 0000000..713b6e2 Binary files /dev/null and b/quizAngular/dist/images/20-1.PNG differ diff --git a/quizAngular/dist/images/20-10.PNG b/quizAngular/dist/images/20-10.PNG new file mode 100755 index 0000000..6f8a6fa Binary files /dev/null and b/quizAngular/dist/images/20-10.PNG differ diff --git a/quizAngular/dist/images/20-11.PNG b/quizAngular/dist/images/20-11.PNG new file mode 100755 index 0000000..dbd75a6 Binary files /dev/null and b/quizAngular/dist/images/20-11.PNG differ diff --git a/quizAngular/dist/images/20-2.PNG b/quizAngular/dist/images/20-2.PNG new file mode 100755 index 0000000..6ce1879 Binary files /dev/null and b/quizAngular/dist/images/20-2.PNG differ diff --git a/quizAngular/dist/images/20-3.PNG b/quizAngular/dist/images/20-3.PNG new file mode 100755 index 0000000..0ed1de4 Binary files /dev/null and b/quizAngular/dist/images/20-3.PNG differ diff --git a/quizAngular/dist/images/20-4.PNG b/quizAngular/dist/images/20-4.PNG new file mode 100755 index 0000000..8cf5a98 Binary files /dev/null and b/quizAngular/dist/images/20-4.PNG differ diff --git a/quizAngular/dist/images/20-5.PNG b/quizAngular/dist/images/20-5.PNG new file mode 100755 index 0000000..05fa63a Binary files /dev/null and b/quizAngular/dist/images/20-5.PNG differ diff --git a/quizAngular/dist/images/20-6.PNG b/quizAngular/dist/images/20-6.PNG new file mode 100755 index 0000000..27d3500 Binary files /dev/null and b/quizAngular/dist/images/20-6.PNG differ diff --git a/quizAngular/dist/images/20-7.PNG b/quizAngular/dist/images/20-7.PNG new file mode 100755 index 0000000..b8b674a Binary files /dev/null and b/quizAngular/dist/images/20-7.PNG differ diff --git a/quizAngular/dist/images/20-8.PNG b/quizAngular/dist/images/20-8.PNG new file mode 100755 index 0000000..727d34f Binary files /dev/null and b/quizAngular/dist/images/20-8.PNG differ diff --git a/quizAngular/dist/images/20-9.PNG b/quizAngular/dist/images/20-9.PNG new file mode 100755 index 0000000..3cc8040 Binary files /dev/null and b/quizAngular/dist/images/20-9.PNG differ diff --git a/quizAngular/dist/images/21-1.PNG b/quizAngular/dist/images/21-1.PNG new file mode 100755 index 0000000..08d56c2 Binary files /dev/null and b/quizAngular/dist/images/21-1.PNG differ diff --git a/quizAngular/dist/images/21-2.PNG b/quizAngular/dist/images/21-2.PNG new file mode 100755 index 0000000..5604176 Binary files /dev/null and b/quizAngular/dist/images/21-2.PNG differ diff --git a/quizAngular/dist/images/21-3.PNG b/quizAngular/dist/images/21-3.PNG new file mode 100755 index 0000000..9042ea1 Binary files /dev/null and b/quizAngular/dist/images/21-3.PNG differ diff --git a/quizAngular/dist/images/21-4.PNG b/quizAngular/dist/images/21-4.PNG new file mode 100755 index 0000000..7da3a78 Binary files /dev/null and b/quizAngular/dist/images/21-4.PNG differ diff --git a/quizAngular/dist/images/21-5.PNG b/quizAngular/dist/images/21-5.PNG new file mode 100755 index 0000000..5298340 Binary files /dev/null and b/quizAngular/dist/images/21-5.PNG differ diff --git a/quizAngular/dist/images/21-6.PNG b/quizAngular/dist/images/21-6.PNG new file mode 100755 index 0000000..f455742 Binary files /dev/null and b/quizAngular/dist/images/21-6.PNG differ diff --git a/quizAngular/dist/images/22-1.PNG b/quizAngular/dist/images/22-1.PNG new file mode 100755 index 0000000..51a53fe Binary files /dev/null and b/quizAngular/dist/images/22-1.PNG differ diff --git a/quizAngular/dist/images/22-2.PNG b/quizAngular/dist/images/22-2.PNG new file mode 100755 index 0000000..a6e5202 Binary files /dev/null and b/quizAngular/dist/images/22-2.PNG differ diff --git a/quizAngular/dist/images/22-3.PNG b/quizAngular/dist/images/22-3.PNG new file mode 100755 index 0000000..30db8bf Binary files /dev/null and b/quizAngular/dist/images/22-3.PNG differ diff --git a/quizAngular/dist/images/22-4.PNG b/quizAngular/dist/images/22-4.PNG new file mode 100755 index 0000000..d9cfdc8 Binary files /dev/null and b/quizAngular/dist/images/22-4.PNG differ diff --git a/quizAngular/dist/images/23-1.PNG b/quizAngular/dist/images/23-1.PNG new file mode 100755 index 0000000..8647a74 Binary files /dev/null and b/quizAngular/dist/images/23-1.PNG differ diff --git a/quizAngular/dist/images/23-2.PNG b/quizAngular/dist/images/23-2.PNG new file mode 100755 index 0000000..25252a7 Binary files /dev/null and b/quizAngular/dist/images/23-2.PNG differ diff --git a/quizAngular/dist/images/23-3.PNG b/quizAngular/dist/images/23-3.PNG new file mode 100755 index 0000000..a1d068b Binary files /dev/null and b/quizAngular/dist/images/23-3.PNG differ diff --git a/quizAngular/dist/images/23-4.PNG b/quizAngular/dist/images/23-4.PNG new file mode 100755 index 0000000..9e58b82 Binary files /dev/null and b/quizAngular/dist/images/23-4.PNG differ diff --git a/quizAngular/dist/images/23-5.PNG b/quizAngular/dist/images/23-5.PNG new file mode 100755 index 0000000..fe0043c Binary files /dev/null and b/quizAngular/dist/images/23-5.PNG differ diff --git a/quizAngular/dist/images/23-6.PNG b/quizAngular/dist/images/23-6.PNG new file mode 100755 index 0000000..ba868cd Binary files /dev/null and b/quizAngular/dist/images/23-6.PNG differ diff --git a/quizAngular/dist/images/23-7.PNG b/quizAngular/dist/images/23-7.PNG new file mode 100755 index 0000000..201d5c8 Binary files /dev/null and b/quizAngular/dist/images/23-7.PNG differ diff --git a/quizAngular/dist/images/24-1.PNG b/quizAngular/dist/images/24-1.PNG new file mode 100755 index 0000000..a1c2367 Binary files /dev/null and b/quizAngular/dist/images/24-1.PNG differ diff --git a/quizAngular/dist/images/24-2.PNG b/quizAngular/dist/images/24-2.PNG new file mode 100755 index 0000000..6752930 Binary files /dev/null and b/quizAngular/dist/images/24-2.PNG differ diff --git a/quizAngular/dist/images/24-3.PNG b/quizAngular/dist/images/24-3.PNG new file mode 100755 index 0000000..cc9f1cd Binary files /dev/null and b/quizAngular/dist/images/24-3.PNG differ diff --git a/quizAngular/dist/images/24-4.PNG b/quizAngular/dist/images/24-4.PNG new file mode 100755 index 0000000..99a9902 Binary files /dev/null and b/quizAngular/dist/images/24-4.PNG differ diff --git a/quizAngular/dist/images/24-5.PNG b/quizAngular/dist/images/24-5.PNG new file mode 100755 index 0000000..63a0408 Binary files /dev/null and b/quizAngular/dist/images/24-5.PNG differ diff --git a/quizAngular/dist/images/24-6.PNG b/quizAngular/dist/images/24-6.PNG new file mode 100755 index 0000000..fbe2074 Binary files /dev/null and b/quizAngular/dist/images/24-6.PNG differ diff --git a/quizAngular/dist/images/25-1.PNG b/quizAngular/dist/images/25-1.PNG new file mode 100755 index 0000000..9085a2a Binary files /dev/null and b/quizAngular/dist/images/25-1.PNG differ diff --git a/quizAngular/dist/images/25-2.PNG b/quizAngular/dist/images/25-2.PNG new file mode 100755 index 0000000..f5ddef0 Binary files /dev/null and b/quizAngular/dist/images/25-2.PNG differ diff --git a/quizAngular/dist/images/25-3.PNG b/quizAngular/dist/images/25-3.PNG new file mode 100755 index 0000000..069326e Binary files /dev/null and b/quizAngular/dist/images/25-3.PNG differ diff --git a/quizAngular/dist/images/25-4.PNG b/quizAngular/dist/images/25-4.PNG new file mode 100755 index 0000000..0289c44 Binary files /dev/null and b/quizAngular/dist/images/25-4.PNG differ diff --git a/quizAngular/dist/images/25-5.PNG b/quizAngular/dist/images/25-5.PNG new file mode 100755 index 0000000..4a3b09e Binary files /dev/null and b/quizAngular/dist/images/25-5.PNG differ diff --git a/quizAngular/dist/images/25-6.PNG b/quizAngular/dist/images/25-6.PNG new file mode 100755 index 0000000..8a7edac Binary files /dev/null and b/quizAngular/dist/images/25-6.PNG differ diff --git a/quizAngular/dist/images/25-7.PNG b/quizAngular/dist/images/25-7.PNG new file mode 100755 index 0000000..d6ca53a Binary files /dev/null and b/quizAngular/dist/images/25-7.PNG differ diff --git a/quizAngular/dist/images/3.PNG b/quizAngular/dist/images/3.PNG new file mode 100755 index 0000000..2bb0f30 Binary files /dev/null and b/quizAngular/dist/images/3.PNG differ diff --git a/quizAngular/dist/images/4.PNG b/quizAngular/dist/images/4.PNG new file mode 100755 index 0000000..64c379b Binary files /dev/null and b/quizAngular/dist/images/4.PNG differ diff --git a/quizAngular/dist/images/6.PNG b/quizAngular/dist/images/6.PNG new file mode 100755 index 0000000..f2c469e Binary files /dev/null and b/quizAngular/dist/images/6.PNG differ diff --git a/quizAngular/dist/images/yeoman.42092f92.png b/quizAngular/dist/images/yeoman.42092f92.png new file mode 100755 index 0000000..92497ad Binary files /dev/null and b/quizAngular/dist/images/yeoman.42092f92.png differ diff --git a/quizAngular/dist/index.html b/quizAngular/dist/index.html new file mode 100755 index 0000000..19ba905 --- /dev/null +++ b/quizAngular/dist/index.html @@ -0,0 +1,32 @@ +

IPRO 207 Interactive ExercisesFrom Physical Ball and Stick to Computer Models of Chemical Systems

\ No newline at end of file diff --git a/quizAngular/dist/robots.txt b/quizAngular/dist/robots.txt new file mode 100755 index 0000000..9417495 --- /dev/null +++ b/quizAngular/dist/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org + +User-agent: * diff --git a/quizAngular/dist/scripts/scripts.c4fe7d99.js b/quizAngular/dist/scripts/scripts.c4fe7d99.js new file mode 100755 index 0000000..a6f7e1c --- /dev/null +++ b/quizAngular/dist/scripts/scripts.c4fe7d99.js @@ -0,0 +1 @@ +"use strict";function quiz(a){return{restrict:"AE",scope:{},templateUrl:"views/template.html",link:function(b,c,d){b.start=function(){b.id=0,b.quizOver=!1,b.inProgress=!0,b.getQuestion()},b.reset=function(){b.inProgress=!1,b.score=0},b.getQuestion=function(){var c=a.getQuestion(b.id),d=a.setSize;c?(b.type=c.type,b.question=c.question,b.options=c.options,b.answer=c.answer,b.imgs=c.imgs,b.answerMode=!0,$("textarea").val(""),$("input:radio:checked").prop("checked",!1),$(".progress-bar").css("width",b.id/d*100+"%")):b.quizOver=!0},b.checkAnswer=function(){switch(b.type){case"0":if(!$("input[name=answer]:checked").length)return;var a=$("input[name=answer]:checked").val();a===b.options[b.answer]?(b.score++,b.correctAns=!0):b.correctAns=!1;break;case"1":var a=$("textarea").val();if(!a.length)return;a===b.answer?(b.score++,b.correctAns=!0):b.correctAns=!1;break;case"3":if(console.log("SMILES is"+SMILES),!SMILES)return;b.answer===SMILES?(b.score++,b.correctAns=!0):b.correctAns=!1}b.answerMode=!1},b.nextQuestion=function(){b.id++,b.getQuestion()},b.reset()}}}function quizFactory(){var a=[{type:"0",question:"Select a correct IUPAC name for the structure below.",options:["2-iodo-4-ethyl-4-methylpentane","3,3-dimethyl-5-iodohexane","2-iodo-4,4-dimethylhexane","2-ethyl-2-methyl-4-iodopentane"],imgs:"1.PNG",answer:2},{type:"0",question:"Select a correct IUPAC name for the structure below.",options:["1-ethyl-1-isopropylhexane","2-methyl-3-ethyloctane","3-ethyl-2-methyloctane","2-methyl-3-pentylpentane"],imgs:"2.PNG",answer:2},{type:"0",question:"Select a correct IUPAC name for the structure below.",options:["2-methyl-3-ethylheptane","3-butyl-2-methylpentane","3-ethyl-2-methylheptane","5-isopropylheptane"],imgs:"3.PNG",answer:2},{type:"1",question:"Name the following compound according to the IUPAC system",options:[],imgs:"4.PNG",answer:"2-ethyl-1,1-dimethylcyclopropane"},{type:"1",question:"Name the following compound according to the IUPAC system",options:[],imgs:"6.PNG",answer:"3-ethyl-2-methylpentane"},{type:"3",question:"Build ethanol.",options:[],imgs:"",answer:"CCO"},{type:"3",question:"Build 5-ethyl-2,3,4-trimethylheptane.",options:[],imgs:"",answer:"CCC(CC)C(C)C(C)C(C)C"},{type:"3",question:"Build 2-chlorobutane.",options:[],imgs:"",answer:"CCC(C)Cl"},{type:"3",question:"Build 2-ethylthiobutane.",options:[],imgs:"",answer:"CCSC(C)CC"},{type:"3",question:"Build 1-methoxybutane.",options:[],imgs:"",answer:"CCCCOC"}];return{setSize:a.length,getQuestion:function(b){return b0&&b-1 in a}function d(a,b,c){if(fa.isFunction(b))return fa.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return fa.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(pa.test(b))return fa.filter(b,a,c);b=fa.filter(b,a)}return fa.grep(a,function(a){return _.call(b,a)>-1!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b={};return fa.each(a.match(va)||[],function(a,c){b[c]=!0}),b}function g(){X.removeEventListener("DOMContentLoaded",g),a.removeEventListener("load",g),fa.ready()}function h(){this.expando=fa.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Ca,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:Ba.test(c)?fa.parseJSON(c):c}catch(e){}Aa.set(a,b,c)}else c=void 0;return c}function j(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return fa.css(a,b,"")},i=h(),j=c&&c[3]||(fa.cssNumber[b]?"":"px"),k=(fa.cssNumber[b]||"px"!==j&&+i)&&Ea.exec(fa.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,fa.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function k(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&fa.nodeName(a,b)?fa.merge([a],c):c}function l(a,b){for(var c=0,d=a.length;d>c;c++)za.set(a[c],"globalEval",!b||za.get(b[c],"globalEval"))}function m(a,b,c,d,e){for(var f,g,h,i,j,m,n=b.createDocumentFragment(),o=[],p=0,q=a.length;q>p;p++)if(f=a[p],f||0===f)if("object"===fa.type(f))fa.merge(o,f.nodeType?[f]:f);else if(La.test(f)){for(g=g||n.appendChild(b.createElement("div")),h=(Ia.exec(f)||["",""])[1].toLowerCase(),i=Ka[h]||Ka._default,g.innerHTML=i[1]+fa.htmlPrefilter(f)+i[2],m=i[0];m--;)g=g.lastChild;fa.merge(o,g.childNodes),g=n.firstChild,g.textContent=""}else o.push(b.createTextNode(f));for(n.textContent="",p=0;f=o[p++];)if(d&&fa.inArray(f,d)>-1)e&&e.push(f);else if(j=fa.contains(f.ownerDocument,f),g=k(n.appendChild(f),"script"),j&&l(g),c)for(m=0;f=g[m++];)Ja.test(f.type||"")&&c.push(f);return n}function n(){return!0}function o(){return!1}function p(){try{return X.activeElement}catch(a){}}function q(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)q(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=o;else if(!e)return a;return 1===f&&(g=e,e=function(a){return fa().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=fa.guid++)),a.each(function(){fa.event.add(this,b,e,d,c)})}function r(a,b){return fa.nodeName(a,"table")&&fa.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function s(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function t(a){var b=Sa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function u(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(za.hasData(a)&&(f=za.access(a),g=za.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)fa.event.add(b,e,j[e][c])}Aa.hasData(a)&&(h=Aa.access(a),i=fa.extend({},h),Aa.set(b,i))}}function v(a,b){var c=b.nodeName.toLowerCase();"input"===c&&Ha.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function w(a,b,c,d){b=Z.apply([],b);var e,f,g,h,i,j,l=0,n=a.length,o=n-1,p=b[0],q=fa.isFunction(p);if(q||n>1&&"string"==typeof p&&!da.checkClone&&Ra.test(p))return a.each(function(e){var f=a.eq(e);q&&(b[0]=p.call(this,e,f.html())),w(f,b,c,d)});if(n&&(e=m(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(g=fa.map(k(e,"script"),s),h=g.length;n>l;l++)i=e,l!==o&&(i=fa.clone(i,!0,!0),h&&fa.merge(g,k(i,"script"))),c.call(a[l],i,l);if(h)for(j=g[g.length-1].ownerDocument,fa.map(g,t),l=0;h>l;l++)i=g[l],Ja.test(i.type||"")&&!za.access(i,"globalEval")&&fa.contains(j,i)&&(i.src?fa._evalUrl&&fa._evalUrl(i.src):fa.globalEval(i.textContent.replace(Ta,"")))}return a}function x(a,b,c){for(var d,e=b?fa.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||fa.cleanData(k(d)),d.parentNode&&(c&&fa.contains(d.ownerDocument,d)&&l(k(d,"script")),d.parentNode.removeChild(d));return a}function y(a,b){var c=fa(b.createElement(a)).appendTo(b.body),d=fa.css(c[0],"display");return c.detach(),d}function z(a){var b=X,c=Va[a];return c||(c=y(a,b),"none"!==c&&c||(Ua=(Ua||fa("