Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/quiz resume #2519

Open
wants to merge 81 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
f897916
initial work
eri-trabiccolo Jul 10, 2023
1b836de
Add changelogs
eri-trabiccolo Jul 10, 2023
9463363
push quiz.js
eri-trabiccolo Jul 10, 2023
ae96a26
Update llms-quiz.js
eri-trabiccolo Jul 11, 2023
99805bb
Added resume button with filter
actuallyakash Jul 12, 2023
96cfab4
added filter for resuming attempt
actuallyakash Jul 13, 2023
305b1e3
disable resume button after quiz is resumed
actuallyakash Jul 13, 2023
d694949
fixed a bug with showing previous question answers
actuallyakash Jul 13, 2023
c842afd
added resume support for blank questions
actuallyakash Jul 13, 2023
61e6093
added changelogs and updated docblocks
actuallyakash Jul 13, 2023
8b8cdf5
removed leave page confirmation alert
actuallyakash Jul 14, 2023
aecd38c
updated button string for restarting quiz
actuallyakash Jul 14, 2023
65ddd46
removing 'resumed' quiz if restart quiz is clicked
actuallyakash Jul 14, 2023
1144f25
added Action schedule for quiz resume
actuallyakash Jul 14, 2023
8951f97
added support for images in tinyMCE
actuallyakash Jul 14, 2023
3dfe82e
fixed warning issue when quiz is not resumable
actuallyakash Jul 17, 2023
3c3dc6c
added changelogs
actuallyakash Jul 17, 2023
19fa143
abstracted the start_quiz() with resume_quiz()
actuallyakash Jul 20, 2023
ee7bacb
minor fixes
actuallyakash Jul 20, 2023
e220e17
minor typos
actuallyakash Jul 20, 2023
f80c24e
Revert "added support for images in tinyMCE"
actuallyakash Jul 25, 2023
1b30ac2
fix tyoo in the changelogs
eri-trabiccolo Jul 27, 2023
3ed5d30
fix can_be_resumed_by_student logic
eri-trabiccolo Jul 27, 2023
6f00dd6
fix some version tags
eri-trabiccolo Jul 27, 2023
3f47803
Merge branch 'feature/quiz-resume' into feature/quiz-resume-akash
eri-trabiccolo Jul 27, 2023
97611e0
Apply suggestions from code review
actuallyakash Aug 2, 2023
8b474cb
code improvements
actuallyakash Aug 3, 2023
4d601b0
fix failing tests
actuallyakash Aug 3, 2023
ea4cc8b
hide grades/answers/points/clarifications for incomplete resumed attempt
actuallyakash Aug 3, 2023
21969b4
minor fixes
actuallyakash Sep 4, 2023
bc3330d
Apply suggestions from code review
actuallyakash Sep 4, 2023
22c343d
Apply suggestions from code review
eri-trabiccolo Sep 5, 2023
6cd1d77
Apply suggestions from code review
eri-trabiccolo Sep 5, 2023
013c072
Merge pull request #2480 from actuallyakash/feature/quiz-resume-akash
eri-trabiccolo Sep 5, 2023
83760d2
Merge branch 'dev' into feature/quiz-resume
eri-trabiccolo Sep 5, 2023
aaa6bce
Merge branch 'dev' into feature/quiz-resume
actuallyakash Oct 3, 2023
11df99d
added exit button for exiting quiz
actuallyakash Oct 6, 2023
51a7c68
added exit button for resumable quiz
actuallyakash Oct 7, 2023
140a87f
added button to clear resumable attempts
actuallyakash Oct 9, 2023
47e4656
added condition to hide clear resumables btn
actuallyakash Oct 9, 2023
283e4c0
added button to disable resume attempt
actuallyakash Oct 10, 2023
0e53043
fixed clear resume button visible on all layouts
actuallyakash Oct 12, 2023
b5dfd12
fix resume button not showing when the last resumable attempt is the …
eri-trabiccolo Oct 12, 2023
fd0863d
Merge branch 'dev' into feature/quiz-resume
eri-trabiccolo Oct 12, 2023
587d675
Merge branch 'dev' into feature/quiz-resume
eri-trabiccolo Oct 20, 2023
78f4035
Merge branch 'dev' into feature/quiz-resume
eri-trabiccolo Nov 3, 2023
a2a22a9
fix some php8.2 warnings
eri-trabiccolo Nov 3, 2023
9dcbc25
Merge pull request #2562 from actuallyakash/akash/quiz-resume
brianhogg Apr 3, 2024
09da400
Merge branch 'dev' into feature/quiz-resume
brianhogg Aug 19, 2024
5841b23
Removing build files.
brianhogg Aug 20, 2024
c39a9f5
Re-adding the refresh warning.
brianhogg Aug 20, 2024
837569b
Adding todo for validation.
brianhogg Aug 20, 2024
05d1467
Merge branch 'dev' into feature/quiz-resume
brianhogg Aug 22, 2024
648884e
Removing unused variable.
brianhogg Aug 22, 2024
8e62964
Removed most changelogs. Fixed resume quiz button text filter (llms v…
brianhogg Aug 22, 2024
292d6be
Saves the last question on Previous. However if you hit Previous on t…
brianhogg Aug 22, 2024
9504456
When resuming quiz, show the question they were last on instead of th…
brianhogg Aug 23, 2024
3ec2665
Separating Restart from Resume button with a notice.
brianhogg Aug 26, 2024
b2b443f
Resume message improvements, avoid asking to reload or sending Comple…
brianhogg Aug 26, 2024
d29c385
Avoid sending the "complete quiz" action on refresh if the quiz is re…
brianhogg Aug 26, 2024
43304d9
Check if the quiz is the latest attempt to see if it can be resumed.
brianhogg Aug 26, 2024
6510531
Avoid showing warnings if there's no end date recorded.
brianhogg Aug 26, 2024
c2fe063
Explicitly end the previous quiz attempt if Restarting the quiz inste…
brianhogg Aug 26, 2024
5fead71
Don't show "you can resume..." message in admin.
brianhogg Aug 26, 2024
eaecaed
End the quiz attempt when disabling resumability.
brianhogg Aug 26, 2024
91687c3
Prevent answers being saved or changed if the attempt is not incomplete.
brianhogg Aug 26, 2024
c10e547
Reverting label change.
brianhogg Aug 26, 2024
08700db
Fix expiry calculation to take timezone into account. Switch expiry t…
brianhogg Aug 27, 2024
bbd8d8b
Check if a resumeable quiz can be resumed before allowing an answer t…
brianhogg Aug 27, 2024
85e4525
Refactor. Removing "what" comment.
brianhogg Aug 27, 2024
7c0552b
Additional checks for getting a question. Refactor to remove if/else.
brianhogg Aug 27, 2024
4b68549
Actually adding image support for question result clarifications.
brianhogg Aug 27, 2024
09ceb97
Undo spacing changes.
brianhogg Aug 27, 2024
2f3c91c
Escaping.
brianhogg Aug 27, 2024
338a904
Fixing last attempt key to check if there is a last attempt first.
brianhogg Aug 27, 2024
4c0ae00
Changing test. We now check for status of "incomplete" before allowin…
brianhogg Aug 27, 2024
8f50201
Fixing answer check.
brianhogg Aug 27, 2024
9b8ee34
Merge branch 'dev' into feature/quiz-resume
brianhogg Aug 27, 2024
3bbc790
Show progress in the progress bar on quiz resume.
brianhogg Aug 29, 2024
9b2de51
Removing error log.
brianhogg Aug 29, 2024
29bf711
Removing "what" comments.
brianhogg Aug 29, 2024
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
4 changes: 4 additions & 0 deletions .changelogs/feature_quiz-resume-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: fixed
entry: Fixed reference in `LLMS_Ajax_Handler::quiz_start()` to
`LLMS_Quiz_Attempt::get_status()` method removed since LifterLMS 4.0.0.
3 changes: 3 additions & 0 deletions .changelogs/feature_quiz-resume-akash-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: changed
entry: Added support for image upload in Result Clarifications box for quizzes.
4 changes: 4 additions & 0 deletions .changelogs/feature_quiz-resume-akash-5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: minor
type: dev
entry: Added filter `llms_quiz_attempt_resume_time_period` for updating quiz resume
allowed time period.
3 changes: 3 additions & 0 deletions .changelogs/feature_quiz-resume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: added
entry: "Added new feature: Quiz Resume."
2 changes: 2 additions & 0 deletions assets/js/builder/Models/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ define( [
* @since 3.16.0
* @since 7.4.0 Added filter for filtering defaults.
* @since 7.5.0 Replaced unused `random_answers` property with `random_questions`.
* @since [version] Added filter for filtering defaults and `can_be_resumed` property.
*
* @return {Object}
*/
Expand All @@ -75,6 +76,7 @@ define( [
random_questions: 'no',
time_limit: 30,
show_correct_answer: 'no',
can_be_resumed: 'no',
disable_retake: 'no',

questions: [],
Expand Down
15 changes: 14 additions & 1 deletion assets/js/builder/Schemas/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* @since 3.17.6
* @since 7.4.0 Added upsell for Question Bank and condition in `random_questions` schema.
* @since 7.6.2 Added `disable_retake` schema.
* @version 7.6.2
* @since [version] Added `can_be_resumed` option.
* @version [version]

*/
define( [], function() {

Expand Down Expand Up @@ -56,6 +58,17 @@ define( [], function() {
type: 'switch-number',
},
], [

{
attribute: 'can_be_resumed',
id: 'resume',
label: LLMS.l10n.translate( 'Can be resumed' ),
tip: LLMS.l10n.translate( 'Allow a new attempt on this quiz to be resumed' ),
type: 'switch',
condition: function() {
return 'yes' === this.get( 'limit_time' ) ? false : true;
}
},
{
attribute: 'show_correct_answer',
id: 'show-correct-answer',
Expand Down
19 changes: 11 additions & 8 deletions assets/js/builder/Views/Question.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* Single Question View
* @since 3.16.0
* @version 3.27.0
* Single Question View.
*
* @since 3.16.0
* @version [version]
*/
define( [
'Views/_Detachable',
Expand Down Expand Up @@ -82,10 +83,12 @@ define( [
},

/**
* Compiles the template and renders the view
* @return self (for chaining)
* @since 3.16.0
* @version 3.16.0
* Compiles the template and renders the view.
*
* @since 3.16.0
* @since [version] Added support for image upload in tinyMCE editor.
*
* @return self (for chaining)
*/
render: function() {

Expand Down Expand Up @@ -124,7 +127,7 @@ define( [

if ( this.model.get( 'clarifications_enabled' ) ) {
this.init_editor( 'question-clarifications--' + this.model.get( 'id' ), {
mediaButtons: false,
mediaButtons: true,
tinymce: {
toolbar1: 'bold,italic,strikethrough,bullist,numlist,alignleft,aligncenter,alignright',
toolbar2: '',
Expand Down
Loading
Loading