Skip to content

Commit

Permalink
tweaks to multiplayeraudio var names
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhunt committed Aug 10, 2022
1 parent f7d4ccb commit 1a7b229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion presets/pw-multiplayeraudio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"MultiPlayerAudio-Widget","key":"pw-multiplayeraudio","version":"1.0.1","instructions":"This is an HTML5 audio player that will only play the audio a preconfigured number of times. Insert an audio player or audio link between the tags.","showatto":"1","showplayers":"0","requirecss":"","requirejs":"","shim":"","defaults":"canplaycount=2,quizstrictmode=false|true","amd":"1","body":"<div id='@@AUTOID@@_container'></div>\n<div id=\"@@AUTOID@@_original\" style=\"display: none\">\n@@canplaycount@@ \n@@quizstrictmode@@ \n@@URLPARAM:attempt@@\n@@URLPARAM:cmid@@","bodyend":"</div>","script":"templates.render('filter_poodll/pw-multiplayeraudio',opts).then(function(html, js) {\n\n // The templates object has append, prepend and replace functions.\n templates.appendNodeContents('#' + @@AUTOID@@ + '_container', html, js);\n \n }).fail(function(ex) {\n // Deal with this exception (I recommend core/notify exception function for this).\n\n });","style":"","dataset":"","datasetvars":"","alternate":"","alternateend":""}
{"name":"MultiPlayerAudio-Widget","key":"pw-multiplayeraudio","version":"1.0.1","instructions":"This is an HTML5 audio player that will only play the audio a preconfigured number of times. Insert an audio player or audio link between the tags.","showatto":"1","showplayers":"0","requirecss":"","requirejs":"","shim":"","defaults":"canplaycount=2,quiz_strict_mode=false|true","amd":"1","body":"<div id='@@AUTOID@@_container'></div>\n<div id=\"@@AUTOID@@_original\" style=\"display: none\">\n@@canplaycount@@ \n@@quiz_strict_mode@@ \n@@URLPARAM:attempt@@\n@@URLPARAM:cmid@@","bodyend":"</div>","script":"templates.render('filter_poodll/pw-multiplayeraudio',opts).then(function(html, js) {\n\n // The templates object has append, prepend and replace functions.\n templates.appendNodeContents('#' + @@AUTOID@@ + '_container', html, js);\n \n }).fail(function(ex) {\n // Deal with this exception (I recommend core/notify exception function for this).\n\n });","style":"","dataset":"","datasetvars":"","alternate":"","alternateend":""}
4 changes: 2 additions & 2 deletions templates/pw-multiplayeraudio.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ aplayer.attr('src',details.mediaurl); // mediaurl, subtitlesurl, sources
var cookiename = details.mediaurl + '_' + "{{URLPARAM:attempt}}"+ '_' + "{{URLPARAM:cmid}}";
console.log(cookiename);
console.log(getCookie(cookiename));
if("{{quizstrictmode}}"=="true" && "{{URLPARAM:attempt}}" !=""){
if("{{quiz_strict_mode}}"=="true" && "{{URLPARAM:attempt}}" !=""){
var prevplaycount = getCookie(cookiename);
if(prevplaycount!==null){
playtimer.data('playtime',prevplaycount);
Expand Down Expand Up @@ -89,7 +89,7 @@ $('#' + "{{AUTOID}}" + '_vol-down').click(function(){
var currentplaycount = playtimer.data('playtime');
currentplaycount--;
//if cookies are enabled set the play count in the cookie
if("{{quizstrictmode}}"=="true" && "{{URLPARAM:attempt}}" !="" ){
if("{{quiz_strict_mode}}"=="true" && "{{URLPARAM:attempt}}" !="" ){
setCookie(cookiename,currentplaycount,1);
}

Expand Down

0 comments on commit 1a7b229

Please sign in to comment.