';
+ $result.='';
return $result;
}
@@ -352,287 +361,6 @@ sub setstudentgrade {
sub submission {
my ($request,$counter,$total) = @_;
- if ($counter == 0) {
- $request->print(<
- function updateRadio(radioButton,formtextbox,formsel,wgt) {
- var pts = formtextbox.value;
- var resetbox =false;
- if (isNaN(pts) || pts < 0) {
- alert("A number equal or greater than 0 is expected. Entered value = "+pts);
- for (var i=0; i 0 && pts < wgt) {
- formsel[4].selected = true;
- }
- if (pts == wgt) {
- formsel[0].selected = true;
- }
- return;
- }
-
- function keywords(keyform) {
- var keywds = keyform.value;
- var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keywds);
- if (nret==null) return;
- keyform.value = nret;
- return;
- }
-
-//===================== Script to add keyword(s) ==================
- function getSel() {
- if (document.getSelection) txt = document.getSelection();
- else if (document.selection) txt = document.selection.createRange().text;
- else return;
- var cleantxt = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");
- if (cleantxt=="") {
- alert("Select a word or group of words from document and then click this link.");
- return;
- }
- var nret = prompt("Add selection to keyword list?",cleantxt);
- if (nret==null) return;
- var curlist = document.SCORE.keywords.value;
- document.SCORE.keywords.value = curlist+" "+nret;
- return;
- }
-
-//====================== Script for composing message ==============
- function msgCenter(msgform,usrctr,fullname) {
- var Nmsg = msgform.savemsgN.value;
- savedMsgHeader(Nmsg,usrctr,fullname);
- var subject = msgform.msgsub.value;
- var rtrchk = eval("document.SCORE.includemsg"+usrctr);
- var msgchk = rtrchk.value;
-// alert("checked=>"+msgchk);
- re = /msgsub/;
- var shwsel = "";
- if (re.test(msgchk)) { shwsel = "checked" }
- displaySubject(subject,shwsel);
- for (var i=1; i<=Nmsg; i++) {
- var testpt = "savemsg"+i+",";
- re = /testpt/;
- shwsel = "";
- if (re.test(msgchk)) { shwsel = "checked" }
- var message = eval("document.SCORE.savemsg"+i+".value");
- displaySavedMsg(i,message,shwsel);
- }
- newmsg = eval("document.SCORE.newmsg"+usrctr+".value");
- shwsel = "";
- re = /newmsg/;
- if (re.test(msgchk)) { shwsel = "checked" }
- newMsg(newmsg,shwsel);
- msgTail();
- return;
- }
-
-function savedMsgHeader(Nmsg,usrctr,fullname) {
- var height = 30*Nmsg+250;
- var scrollbar = "no";
- if (height > 600) {
- height = 600;
- scrollbar = "yes";
- }
-/* if (window.pWin)
- window.pWin.close(); */
- pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',width=600,height='+height);
- pWin.document.write("");
- pWin.document.write("Message Central");
-
- pWin.document.write("
-SUBJAVASCRIPT
-}
(my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
if ($ENV{'form.student'} eq '') { &moreinfo($request,'Need student login id'); return ''; }
my ($uname,$udom) = &finduser($ENV{'form.student'});
@@ -644,42 +372,45 @@ SUBJAVASCRIPT
# header info
if ($counter == 0) {
+ &sub_page_js($request);
$request->print('
Submission Record
'.
' Resource: '.$url.'');
- }
- # option to display problem, only once else it cause problems with the form later since the problem has a form.
- if ($ENV{'form.vProb'} eq 'yes' && $counter == 0) {
- my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom,
- $ENV{'request.course.id'});
- my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom,
- $ENV{'request.course.id'});
- my $result.='
';
- $request->print($result);
- }
+ # option to display problem, only once else it cause problems with the form later
+ # since the problem has a form.
+ if ($ENV{'form.vProb'} eq 'yes') {
+ my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom,
+ $ENV{'request.course.id'});
+ my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom,
+ $ENV{'request.course.id'});
+ my $result.='