forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit brings in canvas_quiz_statistics, a client app that can be embedded in Canvas. Closes CNVS-14781, CNVS-14846, CNVS-14847, CNVS-14850 > What's done - full build integration, meaning the app runs with ?optimized_js=1: + JavaScript "built" source gets piped into the r.js build pipeline like any other Canvas JS source in public/javascripts/* + SCSS sources get picked up by the sass-compiler like Canvas style sources and they get compiled from the grounds-up + I18n: phrases are extracted properly, with default values and options, by our i18n rake tasks - new rake task js:build_client_apps that builds client apps and injects them as input to the rest of the JS build process - support for using Canvas JS packages, like d3, jQuery, and Backbone - support for using Canvas SASS variables & helpers - super i18n support: use raw I18n.t() calls like you are in Canvas, with development-time interpolation, as well as super new Handlebars-like block-style translations in React, perfect for very long phrases (mini-articles) > Docs and References The code was originally developed in its own github repository. While I won't be pushing code to that repo anymore, the Wiki will still house the docs until we find a better place. - Repo: https://github.com/amireh/canvas_quiz_statistics - Development guide: http://bit.ly/1sNOhER - Integration guide: http://bit.ly/1m9kA9V > TESTING - login as a teacher - go to /courses/:course_id/quizzes/:quiz_id/statistics_cqs + make sure you see something that looks like the Ember stats + click one of those little "?" help icons, you get a dialog: - verify the contents within the dialog are actual English text, not code gibberish - there's also a link at the end of that dialog, click it and verify it takes you to an Instructure help article - build the assets: `bundle exec rake canvas:compile_assets` then: + add ?optimized_js=1 to the URL and reload the page: - verify the app still works Change-Id: Ic474650dfb06a1c22869ed9680dd04d1ca0f651d Reviewed-on: https://gerrit.instructure.com/39105 Tested-by: Jenkins <[email protected]> Reviewed-by: Hannah Bottalla <[email protected]> Reviewed-by: Adam Ard <[email protected]> QA-Review: Trevor deHaan <[email protected]> Product-Review: Ahmad Amireh <[email protected]>
- Loading branch information
Showing
154 changed files
with
7,692 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require [ 'quiz_statistics_cqs' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../../../client_apps/canvas_quiz_statistics/src/css/app"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% content_for :page_title, join_title(@quiz.title, t(:page_title, "Statistics CQS")) %> | ||
<% jammit_css :quizzes, :canvas_quiz_statistics %> | ||
<% js_bundle :quiz_statistics_cqs %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# --------------------------------------------------------------------------- # | ||
# TOTALLY EXPERIMENTAL. DO NOT TOUCH. TOTALLY EXPERIMENTAL. | ||
# --------------------------------------------------------------------------- # | ||
|
||
Yes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[autogen] | ||
/.sublime-project.sublime-workspace | ||
/.jshint.html | ||
/doc/api | ||
/doc/coverage | ||
/tests.html | ||
*.swp | ||
|
||
[build] | ||
/tmp/* | ||
|
||
[assets] | ||
exclude | ||
*.zip | ||
*.gz | ||
|
||
[env] | ||
/.ruby-version | ||
/.grunt/ | ||
/node_modules | ||
/assets | ||
/www/dist | ||
/www/fixtures | ||
/www/font | ||
/www/images | ||
/www/src | ||
/www/vendor | ||
/vendor/js/rsvp.js | ||
/src/js/config/environments/development_local.js | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/js/main.js | ||
src/js/bundles/**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"maxerr" : 50, | ||
|
||
"bitwise" : true, | ||
"camelcase" : false, | ||
"curly" : true, | ||
"eqeqeq" : false, | ||
"forin" : true, | ||
"immed" : false, | ||
"indent" : false, | ||
"latedef" : true, | ||
"newcap" : false, | ||
"noarg" : true, | ||
"noempty" : true, | ||
"nonew" : false, | ||
"plusplus" : false, | ||
"quotmark" : false, | ||
|
||
"undef" : true, | ||
"unused" : true, | ||
"strict" : false, | ||
"trailing" : false, | ||
"maxparams" : false, | ||
"maxdepth" : false, | ||
"maxstatements" : false, | ||
"maxcomplexity" : false, | ||
"maxlen" : false, | ||
|
||
"asi" : false, | ||
"boss" : false, | ||
"debug" : false, | ||
"eqnull" : false, | ||
"es5" : false, | ||
"esnext" : false, | ||
"moz" : false, | ||
|
||
"evil" : false, | ||
"expr" : false, | ||
"funcscope" : false, | ||
"globalstrict" : false, | ||
"iterator" : false, | ||
"lastsemic" : false, | ||
"laxbreak" : false, | ||
"laxcomma" : false, | ||
"loopfunc" : false, | ||
"multistr" : false, | ||
"proto" : false, | ||
"scripturl" : false, | ||
"smarttabs" : false, | ||
"shadow" : false, | ||
"sub" : false, | ||
"supernew" : false, | ||
"validthis" : false, | ||
|
||
"browser" : true, | ||
"couch" : false, | ||
"devel" : false, | ||
"dojo" : false, | ||
"jquery" : false, | ||
"mootools" : false, | ||
"node" : false, | ||
"nonstandard" : false, | ||
"prototypejs" : false, | ||
"rhino" : false, | ||
"worker" : false, | ||
"wsh" : false, | ||
"yui" : false, | ||
|
||
"nomen" : false, | ||
"onevar" : false, | ||
"passfail" : false, | ||
"white" : false, | ||
|
||
"globals" : { | ||
"require": false, | ||
"define": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"meta": "gray", | ||
"reason": "cyan", | ||
"verbose": "gray", | ||
"error": "red", | ||
"noproblem": "green" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".", | ||
"folder_exclude_patterns": [ | ||
"build", | ||
"node_modules", | ||
"doc/api", | ||
"doc/assets", | ||
"doc/src", | ||
"doc/vendor", | ||
"doc/dist", | ||
"./assets", | ||
"www/dist", | ||
"www/vendor", | ||
"www/src", | ||
"www/fixtures", | ||
".bundle", | ||
".git", | ||
".grunt", | ||
".yardoc", | ||
"tmp", | ||
"vendor/canvas", | ||
".sass-cache" | ||
], | ||
"file_exclude_patterns": [ | ||
"*.sublime-workspace" | ||
] | ||
} | ||
], | ||
"settings": { | ||
"tab_size": 2, | ||
"translate_tabs_to_spaces": true, | ||
"rulers": [ 80 ], | ||
"trim_automatic_white_space": true | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
client_apps/canvas_quiz_statistics/Gruntfile.development.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* jshint node:true */ | ||
var grunt = require('grunt'); | ||
var readPackage = function() { | ||
return grunt.file.readJSON('package.json'); | ||
}; | ||
|
||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-contrib-connect'); | ||
grunt.loadNpmTasks('grunt-connect-rewrite'); | ||
grunt.loadNpmTasks('grunt-connect-proxy'); | ||
grunt.loadNpmTasks('grunt-contrib-jasmine'); | ||
grunt.loadNpmTasks('grunt-jsduck'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-notify'); | ||
grunt.loadNpmTasks('grunt-newer'); | ||
grunt.loadNpmTasks('grunt-sass'); | ||
|
||
grunt.registerTask('default', [ | ||
'server', | ||
'connect:tests', | ||
'watch' | ||
]); | ||
|
||
grunt.registerTask('updatePkg', function () { | ||
grunt.config.set('pkg', readPackage()); | ||
}); | ||
|
||
grunt.util.loadOptions('./tasks/development/options/'); | ||
grunt.util.loadTasks('./tasks/development'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* jshint node:true */ | ||
|
||
var glob = require('glob'); | ||
var grunt = require('grunt'); | ||
|
||
var readPackage = function() { | ||
return grunt.file.readJSON('package.json'); | ||
}; | ||
|
||
var loadOptions = function(path) { | ||
glob.sync('*', { cwd: path }).forEach(function(option) { | ||
var key = option.replace(/\.js$/,'').replace(/^grunt\-/, ''); | ||
grunt.config.set(key, require(path + option)); | ||
}); | ||
}; | ||
|
||
var loadTasks = function(path) { | ||
glob.sync('*.js', { cwd: path }).forEach(function(taskFile) { | ||
var taskRunner; | ||
var task = require(path + '/' + taskFile); | ||
var taskName = taskFile.replace(/\.js$/, ''); | ||
|
||
taskRunner = task.runner; | ||
|
||
if (taskRunner instanceof Function) { | ||
taskRunner = taskRunner.bind(null, grunt); | ||
} | ||
|
||
grunt.registerTask(taskName, task.description, taskRunner); | ||
}); | ||
}; | ||
|
||
module.exports = function() { | ||
'use strict'; | ||
|
||
grunt.initConfig({ | ||
pkg: readPackage() | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-requirejs'); | ||
grunt.loadNpmTasks('grunt-react'); | ||
grunt.loadNpmTasks('grunt-contrib-symlink'); | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
|
||
grunt.appName = 'Canvas Quiz Statistics'; | ||
grunt.moduleId = 'canvas_quiz_statistics'; | ||
grunt.paths = { | ||
canvasPackageShims: 'tmp/canvas_package_shims.json' | ||
}; | ||
|
||
grunt.util.loadOptions = loadOptions; | ||
grunt.util.loadTasks = loadTasks; | ||
|
||
loadOptions('./tasks/options/'); | ||
loadTasks('./tasks'); | ||
|
||
// Unless invoked using `npm run [sub-script] --production` | ||
if (process.env.NODE_ENV !== 'production') { | ||
require('./Gruntfile.development'); | ||
} | ||
}; |
Oops, something went wrong.