Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
80ac20a
MOBILE-1406 quiz: Implement quiz entry page
dpalou Feb 9, 2016
950c970
MOBILE-1406 quiz: Implement attempt details
dpalou Feb 9, 2016
1412af6
MOBILE-1406 quiz: Check if quiz has questions not supported
dpalou Feb 9, 2016
fea06eb
MOBILE-1411 quiz: Allow starting or continuing a quiz (empty player)
dpalou Feb 10, 2016
84b060e
MOBILE-1411 quiz: Show warning when starting timed quiz
dpalou Feb 10, 2016
65e4845
MOBILE-1411 quiz: Check supported access rules
dpalou Feb 11, 2016
b4b200a
MOBILE-1416 quiz: Implement questions delegate
dpalou Feb 11, 2016
2269761
MOBILE-1416 quiz: Apply questions delegate to player
dpalou Feb 12, 2016
5a47c5b
MOBILE-1416 quiz: Extract scripts from question HTML
dpalou Feb 12, 2016
579a533
MOBILE-1416 quiz: Use delegate to detect supported question types
dpalou Feb 12, 2016
d927e65
MOBILE-1416 quiz: Allow aborting quiz from question handlers
dpalou Feb 12, 2016
e325bc6
MOBILE-1416 quiz: Improve accessibility in entry page and player
dpalou Feb 12, 2016
e531aaf
MOBILE-1420 quiz: Retrieve sequencecheck of questions
dpalou Feb 12, 2016
87baf59
MOBILE-1420 quiz: Create question helper for directives
dpalou Feb 15, 2016
dcf7e26
MOBILE-1420 quiz: Implement multichoice, truefalse and calculatedmulti
dpalou Feb 15, 2016
2e50717
MOBILE-1420 quiz: Implement input text questions
dpalou Feb 15, 2016
4bb9e0e
MOBILE-1420 quiz: Implement description and essay
dpalou Feb 15, 2016
f49d952
MOBILE-1420 quiz: Fix scripts extraction
dpalou Feb 16, 2016
125a99c
MOBILE-1420 quiz: Implement matching question
dpalou Feb 16, 2016
ff992ab
MOBILE-1420 quiz: Implement multianswer (cloze) question
dpalou Feb 16, 2016
8da0340
MOBILE-1420 quiz: Handle validation errors
dpalou Feb 16, 2016
a7c4153
MOBILE-1420 quiz: Implement gapselect question
dpalou Feb 16, 2016
5dd9b4b
MOBILE-1420 quiz: Move some helper functions to mmUtil
dpalou Feb 18, 2016
e2625a4
MOBILE-1420 quiz: Move question to a component
dpalou Feb 18, 2016
786bbee
MOBILE-1420 quiz: Move questions outside of quiz
dpalou Feb 18, 2016
7bf6b3b
MOBILE-1420 quiz: Remove base folder in qtype
dpalou Feb 19, 2016
5feb9ec
MOBILE-1431 quiz: Allow navigation and resume page
dpalou Feb 24, 2016
476fe08
MOBILE-1431 quiz: Apply mmStateClass to templates
dpalou Feb 24, 2016
1ce6376
MOBILE-1431 quiz: Save attempt data on page change or leave
dpalou Feb 25, 2016
9755f96
MOBILE-1417 quiz: Implement access rules delegates and handlers
dpalou Feb 29, 2016
b12c084
MOBILE-1417 quiz: Apply access rules delegate to quiz
dpalou Feb 29, 2016
6d0dde0
MOBILE-1440 quiz: Implement quiz summary before submitting
dpalou Feb 29, 2016
a4d36b6
MOBILE-1440 quiz: Scroll to question when using summary links
dpalou Mar 1, 2016
77bb40e
MOBILE-1444 quiz: Show duedate warn in summary and fix overdue problems
dpalou Mar 1, 2016
b249c1d
MOBILE-1444 quiz: Allow finishing attempts in the app
dpalou Mar 1, 2016
450ab17
MOBILE-1442 quiz: Stop using ng-model in quiz
dpalou Mar 2, 2016
dedfa60
MOBILE-1442 quiz: Fix errors in attempt grade calculation
dpalou Mar 2, 2016
723aae4
MOBILE-1442 quiz: Implement autosave
dpalou Mar 3, 2016
48feac6
MOBILE-1441 quiz: Attempt review initial implementation
dpalou Mar 4, 2016
aca6517
MOBILE-1441 quiz: Adapt questions to review
dpalou Mar 7, 2016
2a36d42
MOBILE-1441 quiz: Go to review after finishing an attempt
dpalou Mar 7, 2016
309ea49
MOBILE-1441 quiz: Handle correctness icons and hidden feedback
dpalou Mar 8, 2016
7817ec1
MOBILE-1441 quiz: Fix scrolling errors in quiz
dpalou Mar 8, 2016
3f3e798
MOBILE-1413 quiz: Capture quiz links to view and review
dpalou Mar 9, 2016
89ae9a8
MOBILE-1443 quiz: Implement quiz timer
dpalou Mar 11, 2016
25e480f
MOBILE-1467 quiz: Use new access WS
dpalou Mar 16, 2016
0f90f19
MOBILE-1445 quiz: Remove review attribute and extract info box
dpalou Mar 17, 2016
45a5663
MOBILE-1445 quiz: Implement question behaviour delegate and handlers
dpalou Mar 18, 2016
4aed2c7
MOBILE-1445 quiz: Apply question heaviours to quiz
dpalou Mar 18, 2016
b15277c
MOBILE-1445 quiz: Handle grade higher than max grade
dpalou Mar 18, 2016
5c896fe
MOBILE-1445 quiz: Prevent access or abort if behaviour not supported
dpalou Mar 18, 2016
dbb00d8
MOBILE-1446 quiz: Don't show flag in the app
dpalou Apr 11, 2016
9d72aba
MOBILE-1446 quiz: Move question status and mark to title
dpalou Apr 11, 2016
461a59a
MOBILE-1446 quiz: Fix error with element.closest not supported
dpalou Apr 14, 2016
3fcf802
MOBILE-1523 quiz: Use right side menu instead of popover
dpalou Apr 13, 2016
877ee6d
MOBILE-1523 quiz: Allow navigating to questions
dpalou Apr 13, 2016
6c3ea61
MOBILE-1523 quiz: Show color status in TOC in review
dpalou Apr 14, 2016
586b426
MOBILE-1529 quiz: Implement quiz prefetch
dpalou Apr 20, 2016
0d30f01
MOBILE-1529 course: Don't block sections while calculating status
dpalou Apr 20, 2016
365b53e
MOBILE-1529 filepool: Fix bug in status when refresh failed
dpalou Apr 20, 2016
9ee6a72
MOBILE-1529 quiz: Show download only if allowofflineattempts
dpalou Apr 20, 2016
032ad32
MOBILE-1418 utils: Calculate element relative position
crazyserver Apr 21, 2016
7af7a06
MOBILE-1418 qtype: Implementation of ddwtos question type
crazyserver Apr 21, 2016
e8df945
MOBILE-1529 quiz: Show open in browser button if not supported
dpalou Apr 26, 2016
3d518b2
MOBILE-1529 quiz: Fix grade in review page
dpalou Apr 26, 2016
0730a6e
MOBILE-1532 question: extractQuestionScripts initObjects correction
crazyserver Apr 26, 2016
48f200a
MOBILE-1532 formatText: Add attribute to avoid adapt images
crazyserver Apr 26, 2016
dd3add7
MOBILE-1532 ddwtos: Remove data-tap-disabled from drag home area
crazyserver Apr 27, 2016
591e051
MOBILE-1532 utils: Correct getElementXY
crazyserver Apr 28, 2016
d80aa0b
MOBILE-1532 quiz: Stop using element.remove, use angular version now
dpalou Apr 28, 2016
9e7fe92
MOBILE-1532 qtype: Implementation of ddmarker question type
crazyserver Apr 26, 2016
15e4fd5
MOBILE-1546 quiz: Fix question directive problem in Android 4.1
dpalou Apr 29, 2016
44894f0
MOBILE-1529 quiz: Add attempts offline access rule
dpalou Apr 26, 2016
153299b
MOBILE-1533 ddmarker: Remove not used function
crazyserver May 6, 2016
a284ccf
MOBILE-1533 qtype: Implementation of ddimageortext question type
crazyserver Apr 26, 2016
f2aa651
MOBILE-1540 quiz: Store answers in offline
dpalou Apr 26, 2016
54fb488
MOBILE-1540 quiz: Load local answers in questions
dpalou Apr 28, 2016
65613fb
MOBILE-1540 quiz: Fix access rules bug in modal
dpalou May 3, 2016
677f96b
MOBILE-1540 quiz: Calculate summary using local data
dpalou May 4, 2016
1740369
MOBILE-1540 quiz: Load CBM from local storage too
dpalou May 4, 2016
3aceabf
MOBILE-1540 quiz: Handle attempts finished offline and not synced
dpalou May 5, 2016
4f59079
MOBILE-1540 quiz: Fix prefetch with new params
dpalou May 5, 2016
4947504
MOBILE-1540 quiz: Add handler functions for ddimageortext
dpalou May 6, 2016
1d0943e
MOBILE-1573 question: Show spinner message while loading images
crazyserver May 9, 2016
8b2cdd0
MOBILE-1534 question: Explain how to drag and drop on mobile
crazyserver May 9, 2016
ef03165
MOBILE-1576 quiz: Fix error with embed elements
dpalou May 9, 2016
62dcbf8
MOBILE-1576 quiz: Start implementing sync process
dpalou May 10, 2016
479972d
MOBILE-1576 quiz: Finish sync function implementation
dpalou May 10, 2016
7ac9918
MOBILE-1576 quiz: Fix querySelector error in d&d
dpalou May 10, 2016
fcfb381
MOBILE-1576 core: Move lastsync string to core
dpalou May 10, 2016
461852c
MOBILE-1576 quiz: Apply quiz synchronization process
dpalou May 11, 2016
defdd50
MOBILE-1576 quiz: Don't show offline access rule if sync is recent
dpalou May 11, 2016
34e4af3
MOBILE-1576 quiz: Go to review if finished offline is synced
dpalou May 11, 2016
40abc7a
MOBILE-1576 quiz: Fix data disappearing while PTR
dpalou May 11, 2016
11342c3
MOBILE-1576 quiz: Download quiz when starting it
dpalou May 11, 2016
2177aeb
MOBILE-1576 quiz: Show automatic sync warnings when viewing quiz
dpalou May 12, 2016
a7d5c76
MOBILE-1576 quiz: Show download icon after finishing offline attempt
dpalou May 12, 2016
24b3e51
MOBILE-1576 quiz: Don't show download if max attempts or no questions
dpalou May 12, 2016
b24e3e4
MOBILE-1581 quiz: Fix offline status calculation errors
dpalou May 13, 2016
e4392f1
MOBILE-1576 quiz: Unblock quiz if JS exception is thrown
dpalou May 17, 2016
25a9b0b
MOBILE-921 quiz: Remove duplicate closest function from rebase
dpalou May 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ gulp.task('watch', function() {
gulp.task('build', function(done) {
var dependencies = ["'mm.core'"],
componentRegex = /core\/components\/([^\/]+)\/main.js/,
pluginRegex = /addons\/([^\/]+)\/main.js/;
pluginRegex = /addons\/([^\/]+)\/main.js/,
subpluginRegex = /addons\/([^\/]+)\/([^\/]+)\/main.js/;

gulp.src(paths.js)
.pipe(gulpSlash())
Expand All @@ -113,6 +114,10 @@ gulp.task('build', function(done) {
dependencies.push("'mm.core." + file.path.match(componentRegex)[1] + "'");
} else if (pluginRegex.test(file.path)) {
dependencies.push("'mm.addons." + file.path.match(pluginRegex)[1] + "'");
} else if (subpluginRegex.test(file.path)) {
// It's a subplugin, use plugin_subplugin to identify it.
var matches = file.path.match(subpluginRegex);
dependencies.push("'mm.addons." + matches[1] + '_' + matches[2] + "'");
}
}))

Expand Down Expand Up @@ -144,7 +149,7 @@ gulp.task('lang', function() {
return fs.readdirSync(dir)
.filter(function(file) {
return file.indexOf('.json') > -1;
})
});
}

/**
Expand Down Expand Up @@ -181,8 +186,13 @@ gulp.task('lang', function() {

} else if (filepath.indexOf('addons') == 0) {

var pluginName = filepath.replace('addons/', '');
pluginName = pluginName.substr(0, pluginName.indexOf('/'));
var split = filepath.split('/'),
pluginName = split[1];

// Check if it's a subplugin. If so, we'll use plugin_subplugin.
if (split[2] != 'lang') {
pluginName = pluginName + '_' + split[2];
}
addProperties(merged, data[filepath], 'mma.'+pluginName+'.');

} else if (filepath.indexOf('core/assets/countries') == 0) {
Expand Down
58 changes: 58 additions & 0 deletions www/addons/mod_quiz/accessrules/delaybetweenattempts/handlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

angular.module('mm.addons.mod_quiz')

/**
* Handler for delaybetweenattempts quiz access rule.
*
* @module mm.addons.mod_quiz
* @ngdoc service
* @name $mmaQuizAccessDelayBetweenAttemptsHandler
*/
.factory('$mmaQuizAccessDelayBetweenAttemptsHandler', function() {

var self = {};

/**
* Whether or not the rule is enabled for the site.
*
* @return {Boolean}
*/
self.isEnabled = function() {
return true;
};

/**
* Check if a preflight check is required.
*
* @param {Object} [attempt] Attempt to continue. Not defined if starting a new attempt.
* @return {Boolean} True if preflight check required.
*/
self.isPreflightCheckRequired = function(attempt) {
return false;
};

return self;
})

.run(function($mmAddonManager) {
// Use addon manager to inject $mmaModQuizAccessRulesDelegate. This is to provide an example for remote addons,
// since they cannot assume that the quiz addon will be packaged in custom apps.
var $mmaModQuizAccessRulesDelegate = $mmAddonManager.get('$mmaModQuizAccessRulesDelegate');
if ($mmaModQuizAccessRulesDelegate) {
$mmaModQuizAccessRulesDelegate.registerHandler('mmaQuizAccessDelayBetweenAttempts', 'quizaccess_delaybetweenattempts',
'$mmaQuizAccessDelayBetweenAttemptsHandler');
}
});
58 changes: 58 additions & 0 deletions www/addons/mod_quiz/accessrules/ipaddress/handlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

angular.module('mm.addons.mod_quiz')

/**
* Handler for ipaddress quiz access rule.
*
* @module mm.addons.mod_quiz
* @ngdoc service
* @name $mmaQuizAccessIpAddressHandler
*/
.factory('$mmaQuizAccessIpAddressHandler', function() {

var self = {};

/**
* Whether or not the rule is enabled for the site.
*
* @return {Boolean}
*/
self.isEnabled = function() {
return true;
};

/**
* Check if a preflight check is required.
*
* @param {Object} [attempt] Attempt to continue. Not defined if starting a new attempt.
* @return {Boolean} True if preflight check required.
*/
self.isPreflightCheckRequired = function(attempt) {
return false;
};

return self;
})

.run(function($mmAddonManager) {
// Use addon manager to inject $mmaModQuizAccessRulesDelegate. This is to provide an example for remote addons,
// since they cannot assume that the quiz addon will be packaged in custom apps.
var $mmaModQuizAccessRulesDelegate = $mmAddonManager.get('$mmaModQuizAccessRulesDelegate');
if ($mmaModQuizAccessRulesDelegate) {
$mmaModQuizAccessRulesDelegate.registerHandler('mmaQuizAccessIpAddress', 'quizaccess_ipaddress',
'$mmaQuizAccessIpAddressHandler');
}
});
58 changes: 58 additions & 0 deletions www/addons/mod_quiz/accessrules/numattempts/handlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

angular.module('mm.addons.mod_quiz')

/**
* Handler for numattempts quiz access rule.
*
* @module mm.addons.mod_quiz
* @ngdoc service
* @name $mmaQuizAccessNumAttemptsHandler
*/
.factory('$mmaQuizAccessNumAttemptsHandler', function() {

var self = {};

/**
* Whether or not the rule is enabled for the site.
*
* @return {Boolean}
*/
self.isEnabled = function() {
return true;
};

/**
* Check if a preflight check is required.
*
* @param {Object} [attempt] Attempt to continue. Not defined if starting a new attempt.
* @return {Boolean} True if preflight check required.
*/
self.isPreflightCheckRequired = function(attempt) {
return false;
};

return self;
})

.run(function($mmAddonManager) {
// Use addon manager to inject $mmaModQuizAccessRulesDelegate. This is to provide an example for remote addons,
// since they cannot assume that the quiz addon will be packaged in custom apps.
var $mmaModQuizAccessRulesDelegate = $mmAddonManager.get('$mmaModQuizAccessRulesDelegate');
if ($mmaModQuizAccessRulesDelegate) {
$mmaModQuizAccessRulesDelegate.registerHandler('mmaQuizAccessNumAttempts', 'quizaccess_numattempts',
'$mmaQuizAccessNumAttemptsHandler');
}
});
30 changes: 30 additions & 0 deletions www/addons/mod_quiz/accessrules/offlineattempts/directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

angular.module('mm.addons.mod_quiz')

/**
* Directive to render offline attempt preflight.
*
* @module mm.addons.mod_quiz
* @ngdoc directive
* @name mmaQuizAccessOfflineAttemptsPreflight
*/
.directive('mmaQuizAccessOfflineAttemptsPreflight', function() {
return {
restrict: 'A',
priority: 100,
templateUrl: 'addons/mod_quiz/accessrules/offlineattempts/template.html'
};
});
86 changes: 86 additions & 0 deletions www/addons/mod_quiz/accessrules/offlineattempts/handlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

angular.module('mm.addons.mod_quiz')

/**
* Handler for offline attempts quiz access rule.
*
* @module mm.addons.mod_quiz
* @ngdoc service
* @name $mmaQuizAccessOfflineAttemptsHandler
*/
.factory('$mmaQuizAccessOfflineAttemptsHandler', function(mmaModQuizSyncTime) {

var self = {};

/**
* Whether or not the rule is enabled for the site.
*
* @return {Boolean}
*/
self.isEnabled = function() {
return true;
};

/**
* Check if a preflight check is required.
*
* @param {Object} [attempt] Attempt to continue. Not defined if starting a new attempt.
* @return {Boolean} True if preflight check required.
*/
self.isPreflightCheckRequired = function(attempt) {
if (!attempt) {
return true;
}

// Show warning if last sync was a while ago.
return new Date().getTime() - mmaModQuizSyncTime > attempt.quizSyncTime;
};

/**
* Get fixed preflight data (data that doesn't require user interaction).
*
* @module mm.addons.mod_quiz
* @ngdoc method
* @name $mmaModQuizAccessRulesDelegate#getFixedPreflightData
* @param {Object} attempt Attempt.
* @param {Object} preflightData Object where to store the preflight data.
* @return {Void}
*/
self.getFixedPreflightData = function(attempt, preflightData) {
preflightData.confirmdatasaved = 1;
};

/**
* Get the name of the directive to be rendered in the preflight form.
*
* @return {String} Directive name.
*/
self.getPreflightDirectiveName = function() {
return 'mma-quiz-access-offline-attempts-preflight';
};

return self;
})

.run(function($mmAddonManager) {
// Use addon manager to inject $mmaModQuizAccessRulesDelegate. This is to provide an example for remote addons,
// since they cannot assume that the quiz addon will be packaged in custom apps.
var $mmaModQuizAccessRulesDelegate = $mmAddonManager.get('$mmaModQuizAccessRulesDelegate');
if ($mmaModQuizAccessRulesDelegate) {
$mmaModQuizAccessRulesDelegate.registerHandler('mmaQuizAccessOfflineAttempts', 'quizaccess_offlineattempts',
'$mmaQuizAccessOfflineAttemptsHandler');
}
});
4 changes: 4 additions & 0 deletions www/addons/mod_quiz/accessrules/offlineattempts/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="item item-text-wrap" ng-init="preflightData.confirmdatasaved = 1">
<p class="item-heading">{{ 'mm.settings.synchronization' | translate }}</p>
<p>{{ 'mma.mod_quiz.confirmcontinueoffline' | translate:{$a: quiz.syncTimeReadable} }}</p>
</div>
Loading