From f73e445b7e229b7ab33da5210ea68d1bfcd8b0a0 Mon Sep 17 00:00:00 2001 From: Ross Cutler <46252169+rosscutler@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:39:57 -0700 Subject: [PATCH] Add problem report button --- src/template/ACRHR_template.html | 27 +++++++++++++++++------- src/template/ACR_template.html | 35 +++++++++++++++++++++---------- src/template/DCR_template.html | 35 +++++++++++++++++++++---------- src/template/avatar_template.html | 23 +++++++++++++++----- 4 files changed, 86 insertions(+), 34 deletions(-) diff --git a/src/template/ACRHR_template.html b/src/template/ACRHR_template.html index 5112eee..95664c3 100644 --- a/src/template/ACRHR_template.html +++ b/src/template/ACRHR_template.html @@ -2061,7 +2061,7 @@ /* Users should not be able to vot before listening the audio clips until the end. */ -function avoidAnsweringBeforeWatchingThrough(){ +function avoidAnsweringBeforeWatchingThrough(){ var i; // Training section for (i = 0; i < config['trainingUrls'].length; i++) { @@ -2071,7 +2071,19 @@ for (i = 0; i < config['questionUrls'].length; i++) { $('input[name="q{0}"]'.f(i+1)).on('change', alertForbiddenChange); } -} +} + +function reportProblem(){ + var desc = prompt('Please describe the problem you encountered:'); + if(desc === null){ + return; + } + var videoUrls = config['questionUrls'].join('\n'); + var browserInfo = $('#browser_info').val(); + var problems = problematic_urls.replace(/
  • /g,'').replace(/<\/li>/g,'\n'); + var body = encodeURIComponent(desc + '\n\nVideo URLs:\n' + videoUrls + '\n\nBrowser Info:\n' + browserInfo + '\n\nProblematic URLs:\n' + problems); + window.location.href = 'mailto:' + config['emailAddress'] + '?subject=Problem Report&body=' + body; +} //------------------------------------------- @@ -2604,11 +2616,12 @@

    Ratings

    Click next to answer all 0 questions, then submit your response.
    + + + diff --git a/src/template/ACR_template.html b/src/template/ACR_template.html index 10a4aea..cb170fa 100644 --- a/src/template/ACR_template.html +++ b/src/template/ACR_template.html @@ -2399,7 +2399,7 @@ /* Users should not be able to vot before listening the audio clips until the end. */ -function avoidAnsweringBeforeWatchingThrough(){ +function avoidAnsweringBeforeWatchingThrough(){ var i; // Training section for (i = 0; i < config['trainingUrls'].length; i++) { @@ -2409,7 +2409,19 @@ for (i = 0; i < config['questionUrls'].length; i++) { $('input[name="q{0}"]'.f(i+1)).on('change', alertForbiddenChange); } -} +} + +function reportProblem(){ + var desc = prompt('Please describe the problem you encountered:'); + if(desc === null){ + return; + } + var videoUrls = config['questionUrls'].join('\n'); + var browserInfo = $('#browser_info').val(); + var problems = problematic_urls.replace(/
  • /g,'').replace(/<\/li>/g,'\n'); + var body = encodeURIComponent(desc + '\n\nVideo URLs:\n' + videoUrls + '\n\nBrowser Info:\n' + browserInfo + '\n\nProblematic URLs:\n' + problems); + window.location.href = 'mailto:' + config['emailAddress'] + '?subject=Problem Report&body=' + body; +} //------------------------------------------- @@ -2957,15 +2969,16 @@

    Ratings

    Click next to answer all 0 questions, then submit your response.
    - - - - + + + + + + +
    diff --git a/src/template/DCR_template.html b/src/template/DCR_template.html index 0fe8bf6..f4f9182 100644 --- a/src/template/DCR_template.html +++ b/src/template/DCR_template.html @@ -2642,7 +2642,7 @@ /* Users should not be able to vot before listening the audio clips until the end. */ -function avoidAnsweringBeforeWatchingThrough(){ +function avoidAnsweringBeforeWatchingThrough(){ var i; // Training section for (i = 0; i < config['trainingUrls'].length; i++) { @@ -2652,7 +2652,19 @@ for (i = 0; i < config['questionUrls'].length; i++) { $('input[name="q{0}"]'.f(i+1)).on('change', alertForbiddenChange); } -} +} + +function reportProblem(){ + var desc = prompt('Please describe the problem you encountered:'); + if(desc === null){ + return; + } + var videoUrls = config['questionUrls'].join('\n'); + var browserInfo = $('#browser_info').val(); + var problems = problematic_urls.replace(/
  • /g,'').replace(/<\/li>/g,'\n'); + var body = encodeURIComponent(desc + '\n\nVideo URLs:\n' + videoUrls + '\n\nBrowser Info:\n' + browserInfo + '\n\nProblematic URLs:\n' + problems); + window.location.href = 'mailto:' + config['emailAddress'] + '?subject=Problem Report&body=' + body; +} //------------------------------------------- @@ -3205,15 +3217,16 @@

    Ratings

    Click next to answer all 0 questions, then submit your response.
    - - - -
  • + + + + + + +
    diff --git a/src/template/avatar_template.html b/src/template/avatar_template.html index 73cf157..804596d 100644 --- a/src/template/avatar_template.html +++ b/src/template/avatar_template.html @@ -2970,6 +2970,18 @@ } } +function reportProblem(){ + var desc = prompt('Please describe the problem you encountered:'); + if(desc === null){ + return; + } + var videoUrls = config['questionUrls'].join('\n'); + var browserInfo = $('#browser_info').val(); + var problems = problematic_urls.replace(/
  • /g,'').replace(/<\/li>/g,'\n'); + var body = encodeURIComponent(desc + '\n\nVideo URLs:\n' + videoUrls + '\n\nBrowser Info:\n' + browserInfo + '\n\nProblematic URLs:\n' + problems); + window.location.href = 'mailto:' + config['emailAddress'] + '?subject=Problem Report&body=' + body; +} + //------------------------------------------- @@ -3547,11 +3559,12 @@

    Ratings

    Click next to answer all 0 questions, then submit your response.
    + + +