Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv8131/WEB-INF/maple/aim/admin
Modified Files:
Tag: develop_2_1
Generate.mpl Notify.mpl Quiz.mpl Register.mpl SourceDir.mpl
SourceFile.mpl Student.mpl Subject.mpl SubjectHome.mpl
Zone.mpl
Added Files:
Tag: develop_2_1
ZoneAdminHome.mpl ZoneStudentHome.mpl
Log Message:
Many changes, mostly to implement multipart questions
--- NEW FILE: ZoneAdminHome.mpl ---
# Copyright (C) 2003 Neil Strickland
# Distributed without warranty under the GPL - see README for details
read("Package.mpl"):
Package("aim/admin/ZoneAdminHome",""):
######################################################################
`aim/admin/Command/Declare`('`admin/ZoneAdminHome`',
['Parameter',
"Action" ::
{"LoadZoneAdminHome","SaveZoneAdminHome"} =
"LoadZoneAdminHome"
],
['Parameter',"HeadText"::`HTML/String` = ""],
['Parameter',"FootText"::`HTML/String` = ""],
##################################################
['Action',"LoadZoneAdminHome",
"Reload the home page header and footer from disk.",
['LinkText' = __("Reload home page")]],
['Action',"SaveZoneAdminHome",
"Save options.",
['LinkText' = __("Save home page")]],
##################################################
['Template',
[["a", "name"="top"]],
["center",
["h1",__("Zone administrator login page editor")]],
["br"],
[["hr","noshade"]],
[["table","width" = "100%"],
["tr",
[["td","width" = "14%"],`HTML/CloseButton`],
[["td","width" = "13%"],
[["a", "href" = "#bottom"],__("Bottom")]],
[["td","width" = "17%"],{["LoadZoneAdminHome"]}],
[["td","width" = "17%"],{["SaveZoneAdminHome"]}],
[["td","width" = "13%"],
[["a", "href" = "#header"],__("Header")]],
[["td","width" = "13%"],
[["a", "href" = "#footer"],__("Footer")]],
[["td","width" = "13%"],
[["a", "href" = "#preview"],__("Preview")]]]],
[["hr", "noshade"]],
["h2",__("Home page")],
["br"],
__("#Explain home page head and foot"),
[["a", "name" = "header"],["h3",__("Header:")]],
["br"],
[["textarea", "name" = "HeadText", "cols" = "70", "rows" = "20"],
{"headtext"}
],
["br"],
[["a", "name"="footer"],["h3",__("Footer:")]],
["br"],
[["textarea", "name" = "FootText", "cols" = "70", "rows" = "10"],
{"foottext"}
],
["br"],
[["hr", "noshade"]],
[["a", "name" = "preview"],["h3",__("Preview:")]],
{"headtext"},
["hr"],
[["font", "color" = "blue"],
__("Subject selection form goes here.")
],
["hr"],
{"foottext"},
["br"],
[["hr", "noshade"]],
[["table","width" = "100%"],
["tr",
[["td","width" = "14%"],`HTML/CloseButton`],
[["td","width" = "17%"],{["LoadZoneAdminHome"]}],
[["td","width" = "17%"],{["SaveZoneAdminHome"]}],
[["td","width" = "13%"],
[["a", "href" = "#top"],__("Top")]],
[["td","width" = "13%"],
[["a", "href" = "#header"],__("Header")]],
[["td","width" = "13%"],
[["a", "href" = "#footer"],__("Footer")]],
[["td","width" = "13%"],
[["a", "href" = "#preview"],__("Preview")]]]],
[["hr", "noshade"]],
[["a", "name"="bottom"]]
],
##################################################
['Process',
proc(page::`aim/admin/Page`,p::table)
local headtext,foottext,headfile,footfile,action;
headfile := cat(DefaultZone['RootDir'],"/adminhead.html");
footfile := cat(DefaultZone['RootDir'],"/adminfoot.html");
action := p["Action"];
if action = "LoadZoneAdminHome" then
headtext := traperror(`Util/TextFileContents`(headfile));
if headtext = lasterror then
headtext := "<h1>Administrator login page</h1>\n<br/>\n";
fi;
foottext := traperror(`Util/TextFileContents`(footfile));
if foottext = lasterror then foottext := ""; fi;
else
headtext := p["HeadText"];
if headtext = "" then
headtext := "<h1>Administrator login page</h1>\n<br/>\n";
fi;
foottext := p["FootText"];
fprintf(headfile,"%s",headtext);
fprintf(footfile,"%s",foottext);
traperror(fclose(headfile));
traperror(fclose(footfile));
fi;
page['Title'] :=__("Administrator login page edit:");
page['FillTemplate',
"Title" = subject['Title'],
"headtext" = headtext,
"foottext" = foottext
];
end
]
):
######################################################################
EndPackage():
--- NEW FILE: ZoneStudentHome.mpl ---
# Copyright (C) 2003 Neil Strickland
# Distributed without warranty under the GPL - see README for details
read("Package.mpl"):
Package("aim/admin/ZoneStudentHome",""):
######################################################################
`aim/admin/Command/Declare`('`admin/ZoneStudentHome`',
['Parameter',
"Action" ::
{"LoadZoneStudentHome","SaveZoneStudentHome"} =
"LoadZoneStudentHome"
],
['Parameter',"HeadText"::`HTML/String` = ""],
['Parameter',"FootText"::`HTML/String` = ""],
##################################################
['Action',"LoadZoneStudentHome",
"Reload the home page header and footer from disk.",
['LinkText' = __("Reload home page")]],
['Action',"SaveZoneStudentHome",
"Save options.",
['LinkText' = __("Save home page")]],
##################################################
['Template',
[["a", "name"="top"]],
["center",
["h1",__("Zone student login page editor")]],
["br"],
[["hr","noshade"]],
[["table","width" = "100%"],
["tr",
[["td","width" = "14%"],`HTML/CloseButton`],
[["td","width" = "13%"],
[["a", "href" = "#bottom"],__("Bottom")]],
[["td","width" = "17%"],{["LoadZoneStudentHome"]}],
[["td","width" = "17%"],{["SaveZoneStudentHome"]}],
[["td","width" = "13%"],
[["a", "href" = "#header"],__("Header")]],
[["td","width" = "13%"],
[["a", "href" = "#footer"],__("Footer")]],
[["td","width" = "13%"],
[["a", "href" = "#preview"],__("Preview")]]]],
[["hr", "noshade"]],
["h2",__("Home page")],
["br"],
__("#Explain home page head and foot"),
[["a", "name" = "header"],["h3",__("Header:")]],
["br"],
[["textarea", "name" = "HeadText", "cols" = "70", "rows" = "20"],
{"headtext"}
],
["br"],
[["a", "name"="footer"],["h3",__("Footer:")]],
["br"],
[["textarea", "name" = "FootText", "cols" = "70", "rows" = "10"],
{"foottext"}
],
["br"],
[["hr", "noshade"]],
[["a", "name" = "preview"],["h3",__("Preview:")]],
{"headtext"},
["hr"],
[["font", "color" = "blue"],
__("Subject selection form goes here.")
],
["hr"],
{"foottext"},
["br"],
[["hr", "noshade"]],
[["table","width" = "100%"],
["tr",
[["td","width" = "14%"],`HTML/CloseButton`],
[["td","width" = "17%"],{["LoadZoneStudentHome"]}],
[["td","width" = "17%"],{["SaveZoneStudentHome"]}],
[["td","width" = "13%"],
[["a", "href" = "#top"],__("Top")]],
[["td","width" = "13%"],
[["a", "href" = "#header"],__("Header")]],
[["td","width" = "13%"],
[["a", "href" = "#footer"],__("Footer")]],
[["td","width" = "13%"],
[["a", "href" = "#preview"],__("Preview")]]]],
[["hr", "noshade"]],
[["a", "name"="bottom"]]
],
##################################################
['Process',
proc(page::`aim/admin/Page`,p::table)
local headtext,foottext,headfile,footfile,action;
headfile := cat(DefaultZone['RootDir'],"/studenthead.html");
footfile := cat(DefaultZone['RootDir'],"/studentfoot.html");
action := p["Action"];
if action = "LoadZoneStudentHome" then
headtext := traperror(`Util/TextFileContents`(headfile));
if headtext = lasterror then
headtext := "<h1>Administrator login page</h1>\n<br/>\n";
fi;
foottext := traperror(`Util/TextFileContents`(footfile));
if foottext = lasterror then foottext := ""; fi;
else
headtext := p["HeadText"];
if headtext = "" then
headtext := "<h1>Administrator login page</h1>\n<br/>\n";
fi;
foottext := p["FootText"];
fprintf(headfile,"%s",headtext);
fprintf(footfile,"%s",foottext);
traperror(fclose(headfile));
traperror(fclose(footfile));
fi;
page['Title'] :=__("Administrator login page edit:");
page['FillTemplate',
"Title" = subject['Title'],
"headtext" = headtext,
"foottext" = foottext
];
end
]
):
######################################################################
EndPackage():
Index: Generate.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Generate.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Generate.mpl 5 May 2003 03:25:46 -0000 1.2
--- Generate.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 109,119 ****
cat(
__("Passwords were generated for the following students:"),
! "\n<br>\n",
studentlist,
! "\n<br>\n",
sprintf(
__("Click on the %s link to send email to these students, telling them their passwords."),
page['ActionLink',"Notify",[idlist]]),
! "\n<br>\n");
fi;
else
--- 109,119 ----
cat(
__("Passwords were generated for the following students:"),
! "\n<br/>\n",
studentlist,
! "\n<br/>\n",
sprintf(
__("Click on the %s link to send email to these students, telling them their passwords."),
page['ActionLink',"Notify",[idlist]]),
! "\n<br/>\n");
fi;
else
***************
*** 123,127 ****
"<font color='red'>",
__("There was an error while generating passwords:"),
! "</font>\n<br>\n<pre>\n",
err,
"\n</pre>\n");
--- 123,127 ----
"<font color='red'>",
__("There was an error while generating passwords:"),
! "</font>\n<br/>\n<pre>\n",
err,
"\n</pre>\n");
Index: Notify.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Notify.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Notify.mpl 5 May 2003 03:25:46 -0000 1.2
--- Notify.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 107,113 ****
html,
__("The following students were notified of their passwords:"),
! "\n<br>\n",
"<table>\n",op(map(line,notified)),"</table>\n",
! "<br>\n";
fi;
--- 107,113 ----
html,
__("The following students were notified of their passwords:"),
! "\n<br/>\n",
"<table>\n",op(map(line,notified)),"</table>\n",
! "<br/>\n";
fi;
***************
*** 115,123 ****
html :=
html,
! "<hr>",
__("The following students were not notified, because their email addresses are not known:"),
! "\n<br>\n",
"<table>\n",op(map(line,noemail)),"</table>\n",
! "<br>\n";
fi;
--- 115,123 ----
html :=
html,
! "<hr/>",
__("The following students were not notified, because their email addresses are not known:"),
! "\n<br/>\n",
"<table>\n",op(map(line,noemail)),"</table>\n",
! "<br/>\n";
fi;
***************
*** 125,135 ****
html :=
html,
! "<hr>",
__("The following students were not found in the register:"),
! "\n<br>\n",
"<table>\n",
op(map(i -> cat("<tr><td>",i,"</td></tr>\n"),badids)),
"</table>\n",
! "<br>\n";
fi;
html := cat(html);
--- 125,135 ----
html :=
html,
! "<hr/>",
__("The following students were not found in the register:"),
! "\n<br/>\n",
"<table>\n",
op(map(i -> cat("<tr><td>",i,"</td></tr>\n"),badids)),
"</table>\n",
! "<br/>\n";
fi;
html := cat(html);
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Quiz.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2
--- Quiz.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 187,191 ****
"rows" = "15" ],
{"selectortext"}],
! "\n<br>\n",
[["hr", "noshade"]],
--- 187,191 ----
"rows" = "15" ],
{"selectortext"}],
! "\n<br/>\n",
[["hr", "noshade"]],
***************
*** 252,256 ****
if err = lasterror then
page['SetError',
! cat(__("Error while creating quiz %s:"),"\n<br>\n%s<br>\n"),
quizname,err];
RETURN();
--- 252,256 ----
if err = lasterror then
page['SetError',
! cat(__("Error while creating quiz %s:"),"\n<br/>\n%s<br/>\n"),
quizname,err];
RETURN();
***************
*** 381,385 ****
[["th", "align" = "left", "width" = "10%"]," "],
[["th", "align" = "left", "width" = "10%"]," "]],
! ["tr", [["td", "colspan" = "6"],["hr"]]]);
if p["ShowHiddenQuestions"] = "true" then
--- 381,385 ----
[["th", "align" = "left", "width" = "10%"]," "],
[["th", "align" = "left", "width" = "10%"]," "]],
! ["tr", [["td", "colspan" = "7"],["hr"]]]);
if p["ShowHiddenQuestions"] = "true" then
Index: Register.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Register.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Register.mpl 5 May 2003 03:25:46 -0000 1.2
--- Register.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 355,359 ****
textfile := p["FileToUpload"];
if not(type([textfile],[string])) then
! page['SetError',__("Invalid upload file:<br> %A<br>"),textfile];
RETURN();
fi;
--- 355,359 ----
textfile := p["FileToUpload"];
if not(type([textfile],[string])) then
! page['SetError',__("Invalid upload file:<br/> %A<br/>"),textfile];
RETURN();
fi;
***************
*** 366,370 ****
err := traperror(register['LoadText',p["FileToUpload"]]);
if err = lasterror then
! page['SetError',__("Error uploading register:<br>%s<br>"),err];
RETURN();
fi;
--- 366,370 ----
err := traperror(register['LoadText',p["FileToUpload"]]);
if err = lasterror then
! page['SetError',__("Error uploading register:<br/>%s<br/>"),err];
RETURN();
fi;
***************
*** 373,377 ****
err := traperror(register['MergeText',textfile]);
if err = lasterror then
! page['SetError',__("Error uploading register:<br>%s<br>"),err];
RETURN();
fi;
--- 373,377 ----
err := traperror(register['MergeText',textfile]);
if err = lasterror then
! page['SetError',__("Error uploading register:<br/>%s<br/>"),err];
RETURN();
fi;
***************
*** 436,440 ****
"<td><input type='checkbox' name='",s['ID'],"Selected'",
`if`(member(s['ID'],sl)," checked",""),
! "></td>\n",
"<td>",s['ID'],"</td>\n",
"<td>",s['Name'],"</td>\n",
--- 436,440 ----
"<td><input type='checkbox' name='",s['ID'],"Selected'",
`if`(member(s['ID'],sl)," checked",""),
! "/></td>\n",
"<td>",s['ID'],"</td>\n",
"<td>",s['Name'],"</td>\n",
***************
*** 467,471 ****
"</tr>\n",
op(map(studentline,studentlist,page,selected)),
! "</table>\n<br>\n");
page['Title'] :=
--- 467,471 ----
"</tr>\n",
op(map(studentline,studentlist,page,selected)),
! "</table>\n<br/>\n");
page['Title'] :=
Index: SourceDir.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SourceDir.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** SourceDir.mpl 5 May 2003 03:25:46 -0000 1.2
--- SourceDir.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 167,171 ****
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
--- 167,171 ----
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br/>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
***************
*** 174,178 ****
"<td>",quiztitle,"</td></tr>\n",
"</table>",
! "\n<br>\n");
shorttitle :=
sprintf("%s:%s:%s",__("Source"),subjname,quizname);
--- 174,178 ----
"<td>",quiztitle,"</td></tr>\n",
"</table>",
! "\n<br/>\n");
shorttitle :=
sprintf("%s:%s:%s",__("Source"),subjname,quizname);
***************
*** 181,190 ****
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
"<td>",subjtitle,"</td></tr>\n",
"</table>",
! "\n<br>\n");
shorttitle :=
sprintf("%s:%s",__("Source"),subjname);
--- 181,190 ----
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br/>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
"<td>",subjtitle,"</td></tr>\n",
"</table>",
! "\n<br/>\n");
shorttitle :=
sprintf("%s:%s",__("Source"),subjname);
***************
*** 194,198 ****
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
--- 194,198 ----
title :=
cat(
! "<h1>",__("AIM source files"),"</h1><br/>\n",
"<table>\n",
"<tr><td>",__("Subject:"),"</td>\n",
***************
*** 201,205 ****
"<td>",p["Dir"],"</td></tr>\n",
"</table>",
! "\n<br>\n");
shorttitle :=
sprintf("%s:%s",__("Source"),subjname,p["Dir"]);
--- 201,205 ----
"<td>",p["Dir"],"</td></tr>\n",
"</table>",
! "\n<br/>\n");
shorttitle :=
sprintf("%s:%s",__("Source"),subjname,p["Dir"]);
Index: SourceFile.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SourceFile.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** SourceFile.mpl 5 May 2003 03:25:46 -0000 1.2
--- SourceFile.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 314,318 ****
if nops(questions) = 0 then
! compreport := compreport,"\n<br>\n",__("No questions found"),"\n<br>\n";
fi;
--- 314,318 ----
if nops(questions) = 0 then
! compreport := compreport,"\n<br/>\n",__("No questions found"),"\n<br/>\n";
fi;
***************
*** 341,352 ****
compreport :=
compreport,
! "<hr noshade>\n",
sprintf(
! __("Question <font color='red'><tt>%s</tt></font>: compilation error\n<br>\n"),
qname),
msg;
if errline > 0 then
! compreport := compreport,"\n<hr>\n<pre>\n";
for i from 1 to errline - 1 do
compreport := compreport,lines[i];
--- 341,352 ----
compreport :=
compreport,
! "<hr noshade/>\n",
sprintf(
! __("Question <font color='red'><tt>%s</tt></font>: compilation error\n<br/>\n"),
qname),
msg;
if errline > 0 then
! compreport := compreport,"\n<hr/>\n<pre>\n";
for i from 1 to errline - 1 do
compreport := compreport,lines[i];
***************
*** 363,367 ****
fi;
! compreport := compreport,"<hr noshade>\n";
else
compreport :=
--- 363,367 ----
fi;
! compreport := compreport,"<hr noshade/>\n";
else
compreport :=
***************
*** 369,375 ****
"<font color='red'>",
__("Error: malformed compilation report"),
! "</font>\n<br>\n<pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre>\n<br>\n";
fi;
od;
--- 369,375 ----
"<font color='red'>",
__("Error: malformed compilation report"),
! "</font>\n<br/>\n<pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre>\n<br/>\n";
fi;
od;
Index: Student.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Student.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Student.mpl 5 May 2003 03:25:46 -0000 1.2
--- Student.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 236,240 ****
"value=\"",student['Password'],"\" ",
"size=\"50\" ",
! "name=\"StudentPassword\"></td>\n",
"</tr>\n");
--- 236,240 ----
"value=\"",student['Password'],"\" ",
"size=\"50\" ",
! "name=\"StudentPassword\"/></td>\n",
"</tr>\n");
Index: Subject.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Subject.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Subject.mpl 5 May 2003 03:25:46 -0000 1.2
--- Subject.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 340,344 ****
if err = lasterror then
page['SetError',
! cat(__("Error while creating subject %s:"),"\n<br>\n%s<br>\n"),
subjectname,err];
RETURN();
--- 340,344 ----
if err = lasterror then
page['SetError',
! cat(__("Error while creating subject %s:"),"\n<br/>\n%s<br/>\n"),
subjectname,err];
RETURN();
Index: SubjectHome.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SubjectHome.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** SubjectHome.mpl 5 May 2003 03:25:46 -0000 1.2
--- SubjectHome.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 123,127 ****
if headtext = lasterror then
! headtext := sprintf("<h1>%s</h1>\n<br>\n",subject['Title']);
fi;
--- 123,127 ----
if headtext = lasterror then
! headtext := sprintf("<h1>%s</h1>\n<br/>\n",subject['Title']);
fi;
***************
*** 133,137 ****
headtext := p["HeadText"];
if headtext = "" then
! headtext := sprintf("<h1>%s</h1>\n<br>\n",subject['Title']);
fi;
--- 133,137 ----
headtext := p["HeadText"];
if headtext = "" then
! headtext := sprintf("<h1>%s</h1>\n<br/>\n",subject['Title']);
fi;
Index: Zone.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Zone.mpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Zone.mpl 5 May 2003 03:25:46 -0000 1.2
--- Zone.mpl 10 Jul 2003 20:10:04 -0000 1.2.2.1
***************
*** 86,89 ****
--- 86,105 ----
'Command' = "admin/Register"]],
+ ['Action',"EditStudentHome",
+ "Edit the header and footer for the home page seen by students.
+ (In between the header and footer goes an automatically generated
+ quiz selection form.",
+ ['LinkText' = __("Edit student login page"),
+ 'Command' = "admin/ZoneStudentHome"]
+ ],
+
+ ['Action',"EditAdminHome",
+ "Edit the header and footer for the home page seen by students.
+ (In between the header and footer goes an automatically generated
+ quiz selection form.",
+ ['LinkText' = __("Edit administrator login page"),
+ 'Command' = "admin/ZoneAdminHome"]
+ ],
+
##################################################
***************
*** 190,195 ****
--- 206,213 ----
[["td", "width" = "50%", "align" = "right"],
{"togglehidden"}]]],
+ {"explainhidden"},
{"subjecttable"},
["br"],
+ ["hr"],
__("New subject:")," ",
[["inputtext", "name" = "SubjectToCreate", "value" = ""]],
***************
*** 198,201 ****
--- 216,230 ----
__("#Explain new subjects hidden"),
[["hr","noshade"]],
+
+ ##########
+
+ ["h2",__("Login pages")],
+ ["br"],
+ {["EditStudentHome"]},
+ ["br"],
+ {["EditAdminHome"]},
+ ["br"],
+ [["hr","noshade"]],
+
[["table","width" = "100%"],
["tr",
***************
*** 206,244 ****
[["td","width" = "17%"],{["SaveZoneOptions"]}]]],
[["hr", "noshade"]],
-
- ##########
-
- ["h2",__("Student login page")],
- ["br"],
- __("#Explain student head and foot"),
- ["h3",__("Header:")],
- ["br"],
- [["textarea", "name" = "StudentHead", "cols" = "70", "rows" = "20"],
- {"studenthead"}
- ],
- ["br"],
- ["h3",__("Footer:")],
- ["br"],
- [["textarea", "name" = "StudentFoot", "cols" = "70", "rows" = "10"],
- {"studentfoot"}
- ],
- ["br"],
-
- ["h2",__("Administrator login page")],
- ["br"],
- __("#Explain admin head and foot"),
- ["h3",__("Header:")],
- ["br"],
- [["textarea", "name" = "AdminHead", "cols" = "70", "rows" = "20"],
- {"adminhead"}
- ],
- ["br"],
- ["h3",__("Footer:")],
- ["br"],
- [["textarea", "name" = "AdminFoot", "cols" = "70", "rows" = "10"],
- {"adminfoot"}
- ],
- ["br"],
-
[["a", "name"="bottom"]]
],
--- 235,238 ----
***************
*** 250,254 ****
local subject,excludedsubject,nam,subjectlist,ord,err,
! subjecttable,subjectnumber,togglehidden,hiddensubjects,
studenthead,studentfoot,adminhead,adminfoot,
studentheadfile,studentfootfile,adminheadfile,adminfootfile;
--- 244,249 ----
local subject,excludedsubject,nam,subjectlist,ord,err,
! subjecttable,subjectnumber,togglehidden,explainhidden,
! hiddensubjects,visiblesubjects,
studenthead,studentfoot,adminhead,adminfoot,
studentheadfile,studentfootfile,adminheadfile,adminfootfile;
***************
*** 363,437 ****
fi;
- subjecttable :=
- `new/HTML/Tag`(
- ["table", "width" = "100%"],
- ["tr",
- [["th", "align" = "left", "width" = "10%"],
- __("Subject number")],
- [["th", "align" = "left", "width" = "50%"],
- __("Name")],
- [["th", "align" = "left", "width" = "10%"]," "],
- [["th", "align" = "left", "width" = "10%"]," "],
- [["th", "align" = "left", "width" = "10%"]," "],
- [["th", "align" = "left", "width" = "10%"]," "]],
- ["tr", [["td", "colspan" = "8"],["hr"]]]);
-
- if p["ShowHiddenSubjects"] = "true" then
- togglehidden := page['ActionLink',"HideHiddenSubjects"];
- subjecttable['AddContents',
- ["tr",[["td", "colspan" = "8"],
- __("Visible subjects")]]];
- else
- togglehidden :=
- sprintf(__("#Explain hidden subjects (%s)"),
- page['ActionLink',"ShowHiddenSubjects"]);
- fi;
! subjectnumber := 0;
! for nam in DefaultZone['SubjectNames'] do
! subjectnumber := subjectnumber + 1;
! subjecttable['AddContents',
! ["tr",
! [["td", "align" = "left"],
! [["inputtext",
! "name" = cat(nam,"Order"),
! "value" = sprintf("%A",subjectnumber),
! "size" = "3"]]],
! [["td","align" = "left"],nam],
! [["td","align" = "left"],
! page['ActionLink',"LoadSubjectOptions",[nam]]],
! [["td","align" = "left"],
! page['ActionLink',"AnalyzeSubject",[nam]]],
! [["td","align" = "left"],
! page['ActionLink',"ToggleSubject",[nam],__("Hide")]]]]
! od;
! if p["ShowHiddenSubjects"] = "true" then
! subjecttable['AddContents',
! ["tr",[["td", "colspan" = "8"],["hr"]]],
! ["tr",[["td", "colspan" = "8"],
! __("Hidden subjects")]]];
! hiddensubjects :=
! `OS/ListFiles`(cat(DefaultZone['RootDir'],"/subjects"));
! hiddensubjects :=
! {op(hiddensubjects)} minus {op(DefaultZone['SubjectNames'])};
! hiddensubjects := sort([op(hiddensubjects)]);
! for nam in hiddensubjects do
subjecttable['AddContents',
["tr",
! [["td", "align" = "left"], " "],
! [["td","align" = "left"],nam],
! [["td","align" = "left"],
! page['ActionLink',"LoadSubjectOptions",[nam]]],
! [["td","align" = "left"]," "],
! [["td","align" = "left"],
! page['ActionLink',"ToggleSubject",[nam],__("Unhide")]]]]
! od;
! fi;
page['Title'] := __("Zone:");
--- 358,456 ----
fi;
! visiblesubjects := DefaultZone['SubjectNames'];
! hiddensubjects :=
! `OS/ListFiles`(cat(DefaultZone['RootDir'],"/subjects"));
! hiddensubjects :=
! {op(hiddensubjects)} minus {op(visiblesubjects)};
! hiddensubjects := sort([op(hiddensubjects)]);
! if visiblesubjects = [] and
! hiddensubjects = [] then
! subjecttable :=
! __("There are no visible or hidden subjects for this zone.");
! else
! subjecttable :=
! `new/HTML/Tag`(
! ["table", "width" = "100%"],
! ["tr",
! [["th", "align" = "left", "width" = "10%"],
! __("Subject number")],
! [["th", "align" = "left", "width" = "50%"],
! __("Name")],
! [["th", "align" = "left", "width" = "10%"]," "],
! [["th", "align" = "left", "width" = "10%"]," "],
! [["th", "align" = "left", "width" = "10%"]," "],
! [["th", "align" = "left", "width" = "10%"]," "]],
! ["tr", [["td", "colspan" = "8"],["hr"]]]);
! if p["ShowHiddenSubjects"] = "true" then
! togglehidden := page['ActionLink',"HideHiddenSubjects"];
! explainhidden := "";
! subjecttable['AddContents',
! ["tr",[["td", "colspan" = "8"],
! __("Visible subjects")]]];
! else
! togglehidden := page['ActionLink',"ShowHiddenSubjects"];
! explainhidden :=
! sprintf(__("#Explain hidden subjects (%s)"),
! page['ActionLink',"ShowHiddenSubjects"]);
! fi;
! if visiblesubjects = [] then
subjecttable['AddContents',
["tr",
! [["td", "align" = "center","colspan" = "8"],
! __("There are no visible subjects for this zone.")]]];
! else
! subjectnumber := 0;
! for nam in DefaultZone['SubjectNames'] do
! subjectnumber := subjectnumber + 1;
! subjecttable['AddContents',
! ["tr",
! [["td", "align" = "left"],
! [["inputtext",
! "name" = cat(nam,"Order"),
! "value" = sprintf("%A",subjectnumber),
! "size" = "3"]]],
! [["td","align" = "left"],nam],
! [["td","align" = "left"],
! page['ActionLink',"LoadSubjectOptions",[nam]]],
! [["td","align" = "left"],
! page['ActionLink',"AnalyzeSubject",[nam]]],
! [["td","align" = "left"],
! page['ActionLink',"ToggleSubject",[nam],__("Hide")]]]]
! od;
! fi;
!
! if p["ShowHiddenSubjects"] = "true" then
! if hiddensubjects = [] then
! subjecttable['AddContents',
! ["tr",
! [["td", "align" = "center","colspan" = "8"],
! __("There are no hidden subjects for this zone.")]]];
! else
! subjecttable['AddContents',
! ["tr",[["td", "colspan" = "8"],["hr"]]],
! ["tr",[["td", "colspan" = "8"],
! __("Hidden subjects")]]];
!
! for nam in hiddensubjects do
! subjecttable['AddContents',
! ["tr",
! [["td", "align" = "left"], " "],
! [["td","align" = "left"],nam],
! [["td","align" = "left"],
! page['ActionLink',"LoadSubjectOptions",[nam]]],
! [["td","align" = "left"]," "],
! [["td","align" = "left"],
! page['ActionLink',"ToggleSubject",[nam],__("Unhide")]]]]
! od;
! fi;
! fi;
! fi;
page['Title'] := __("Zone:");
***************
*** 452,455 ****
--- 471,475 ----
page['FillTemplate',
"togglehidden" = togglehidden,
+ "explainhidden" = explainhidden,
"subjecttable" = subjecttable['ToString'],
"studenthead" = studenthead,
|