Sending of results not working

49 views
Skip to first unread message

jean-marc Cadio

unread,
Apr 11, 2021, 6:52:27 AM4/11/21
to hotpotatoesusers

Dear everyone,

After sending Agnès an e-mail about mini-player, I've tried creating a jmatch exercise. However the function sending of results doesn't work any longer.




I used to have this in my jmatch .htm files

//CODE FOR HANDLING SENDING OF RESULTS


var UserName = '';

var StartTime = (new Date()).toLocaleString();


var ResultForm = '<html><body><form name="Results" action="../../traitement.php" method="post" enctype="x-www-form-encoded">';

ResultForm += '<input type="hidden" name="recipient" value=""></input>';

ResultForm += '<input type="hidden" name="subject" value="Vocabulary : Biography"></input>';

ResultForm += '<input type="hidden" name="Exercise" value="Vocabulary : Biography"></input>';

ResultForm += '<input type="hidden" name="realname" value=""></input>';

ResultForm += '<input type="hidden" name="Score" value=""></input>';

ResultForm += '<input type="hidden" name="Start_Time" value=""></input>';

ResultForm += '<input type="hidden" name="End_Time" value=""></input>';

ResultForm += '<input type="hidden" name="title" value="Thanks!"></input>';

ResultForm += '<input type="hidden" name="bgcolor" value="#f9e4b1"></input>';

ResultForm += '<input type="hidden" name="text_color" value="#000033"></input>';

ResultForm += '<input type="hidden" name="sort" value="order:realname,Exercise,Score,Start_Time,End_Time"></input>';

ResultForm += '</form></body></html>';


function GetUserName()

{


}


function SendResults(Score){

var today = new Date;

var NewName = '' + today.getTime();

var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300');


//If user has prevented popups, no way to proceed -- exit

if (NewWin == null){

return;

}


NewWin.document.clear();

NewWin.document.open();

NewWin.document.write(ResultForm);

NewWin.document.close();

NewWin.document.Results.Score.value = Score + '%';

NewWin.document.Results.realname.value = UserName;

NewWin.document.Results.End_Time.value = (new Date()).toLocaleString();

NewWin.document.Results.Start_Time.value = StartTime;

NewWin.document.Results.submit();

}


and now I get this





//CODE FOR HANDLING SENDING OF RESULTS

var UserName = '';

var StartTime = (new Date()).toLocaleString();



var ResultForm = '<form name="Results" id="Results" action="../../traitement.php" method="post" enctype="x-www-form-encoded">';

ResultForm += '<input type="hidden" name="recipient" value=""></input>';

ResultForm += '<input type="hidden" name="subject" value="Vocabulary : Biography"></input>';

ResultForm += '<input type="hidden" name="Exercise" value="Vocabulary : Biography"></input>';

ResultForm += '<input type="hidden" name="realname" value=""></input>';

ResultForm += '<input type="hidden" name="Score" value=""></input>';

ResultForm += '<input type="hidden" name="Start_Time" value=""></input>';

ResultForm += '<input type="hidden" name="End_Time" value=""></input>';

ResultForm += '<input type="hidden" name="title" value="Thanks!"></input>';

ResultForm += '<input type="hidden" name="httpReferrer" value="' + document.location.href + '"></input>';

ResultForm += '<input type="hidden" name="bgcolor" value="' + getComputedStyle(document.documentElement).getPropertyValue('--strPageBGColor') +'"></input>';

ResultForm += '<input type="hidden" name="text_color" value="' + getComputedStyle(document.documentElement).getPropertyValue('--strTitleColor') + '"></input>';

ResultForm += '<input type="hidden" name="sort" value="order:realname,Exercise,Score,Start_Time,End_Time,httpReferrer"></input>';

ResultForm += '</form>';



function GetUserName(){



}



function SendResults(Score){

var today = new Date;

var NewName = '' + today.getTime();

var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300');



//If user has prevented popups, no way to proceed -- exit

if (NewWin == null){

return;

}



NewWin.document.body.innerHTML = ResultForm;

var frm = NewWin.document.getElementById('Results');

frm.Score.value = Score + '%';

frm.realname.value = UserName;

frm.End_Time.value = (new Date()).toLocaleString();

frm.Start_Time.value = StartTime;

frm.submit();

}

What can I do to make it work again?

Thanks in advance.


Jean-Marc Cadio

53000 Laval - France

https://anglais.martonne.net



Daniele Passegua

unread,
Apr 11, 2021, 6:54:16 AM4/11/21
to hotpotatoesusers
Same problem for me. Too bad since sending results is quite useful.
Please help us to solve this.
Thanks

Pascal Scalpa

unread,
Apr 11, 2021, 9:25:58 AM4/11/21
to hotpotatoesusers
Avec HP7, il faut, je crois, utiliser les chemins absolus(https://monsite.com/scalpatatoes/exercices/traitement.php  ) avec HP7 et non relatif ( ../../traitement.php  ). Cf conversation avec M. Holmes.

Ce qui est dommage d'ailleurs car cela oblige à avoir 2 versions une en locale et une en ligne....différente.
cdt
pascal

jean-marc Cadio

unread,
Apr 11, 2021, 10:10:06 AM4/11/21
to hotpotatoesusers
Thanks a lot. It works!!!!!
Ready for plenty of new exercises with this new mini-player.

--
You received this message because you are subscribed to a topic in the Google Groups "hotpotatoesusers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hotpotatoesusers/iXRGeTUtApk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hotpotatoesuse...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hotpotatoesusers/6663d110-0132-4fe5-a5e4-39d46f7d84f5n%40googlegroups.com.

Pascal Scalpa

unread,
Apr 11, 2021, 10:47:31 AM4/11/21
to hotpotatoesusers
Be careful on your site, anyone can do the exercises dedicated to your students... and record a score without being identified... and anyone has an access to pupils results... not fair!

Martin Holmes

unread,
Apr 11, 2021, 12:40:27 PM4/11/21
to hotpotat...@googlegroups.com
If someone can post the URL of a page which is broken, we might possibly
be able to figure out a solution.

Cheers,
Martin
> https://anglais.martonne.net <https://anglais.martonne.net/>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "hotpotatoesusers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hotpotatoesuse...@googlegroups.com
> <mailto:hotpotatoesuse...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/hotpotatoesusers/0b28896e-36b8-46ae-981d-ac6be153527fn%40googlegroups.com
> <https://groups.google.com/d/msgid/hotpotatoesusers/0b28896e-36b8-46ae-981d-ac6be153527fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

jean-marc Cadio

unread,
Apr 11, 2021, 6:33:26 PM4/11/21
to hotpotatoesusers
Hello everyone,
it used to work with a relative link, but it doesn't any more. So I need to write an absolute link for the results to be taken into account.
Thanks for helping me.
Jean-Marc

Pascal Scalpa

unread,
Apr 12, 2021, 5:24:18 AM4/12/21
to hotpotatoesusers
I already answered yesterday, didn't I?

Daniele Passegua

unread,
Apr 12, 2021, 7:30:23 AM4/12/21
to hotpotatoesusers
You wrote: " Thanks a lot. It works!!!!! "

Please tell me in details how did you solve this issue, many thanks.

jean-marc Cadio

unread,
Apr 15, 2021, 12:21:49 PM4/15/21
to hotpotatoesusers
Hello,
As I said before, I used an absolute line in "Configure Output",  "CGI", "URL of formMail CGI script" so the results are sent to my exercise bank working with Stckpotatoes which you'l find here : https://stockpotatoes.ovh/ .
Cheers,
Jean-Marc

Daniele Passegua

unread,
Apr 15, 2021, 12:35:23 PM4/15/21
to hotpotatoesusers
Thanks again, I'll try asap that change. Mean while I'm curious about stockpotatoes, could you kindly tell us more about it? Regards
Reply all
Reply to author
Forward
0 new messages