Skip to content

Commit

Permalink
Create links to PGProblemEditor2. Adjust math3.css and math2.css to d…
Browse files Browse the repository at this point in the history
…isplay viewing window.
  • Loading branch information
mgage committed Apr 19, 2012
1 parent 0326da0 commit 92fcea5
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 13 deletions.
97 changes: 90 additions & 7 deletions conf/templates/math2/math2.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ h2.compound { float: right; margin: 0; padding: 0 }*/
-moz-border-radius-topright: 1.5ex; -moz-border-radius-topleft: 1.5ex;
margin-bottom: 1ex;
margin-top: 0;
width: 90%;
overflow: hidden;
}
.info-box h2,
Expand Down Expand Up @@ -279,11 +280,33 @@ clear: both;
}*/
/* [ww] instead of a search form, we want the loginstatus there */
/*#masthead form {*/

/*Loginstatus -- the element fixed on the top right corner of the page, which tells the user whether they are logged in or not, and provides them with a log out link if they are logged in.*/

#masthead #loginstatus {
float: right;
padding: 0;
margin: 1ex .5em .1ex .1em;
font-size: smaller;
}

/*Relative Positioning -- a alternate style for the loginstatus which uses relative positioning. Tested, but was decided that it didn't work great. Feel free to uncomment if you want to try it out.*/

/*#loginstatus {
color: white;
position: relative;
top: -140px;
left: 470px;
width: 150px;
text-align: center;
padding: 0;
margin: 1ex .5em .1ex .1em;
font-size: smaller;
}*/


#loginstatus a{
color: white;
}
#masthead #loginstatus #Nav {
padding: 1ex;
Expand Down Expand Up @@ -404,11 +427,11 @@ clear: both;
font-size:100%;
float: right;
max-width: 40%;
min-width: 0;
overflow: auto;
margin-right: -1px;
/*margin-right: -1px;*/
background-color: #fff;
}

#InfoPanel ol {
font-size:100%;
}
Expand All @@ -429,17 +452,17 @@ div.AuthorComment { background-color: #00E0E0; color: black; }
/*ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; }*/

/* background styles for success and failure messages */
div.WarningMessage { background-color: #ffcccc; padding: 3px 3px 3px 3px; }
div.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
div.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
div.ResultsWithError { color: #C33; background-color: inherit; } /* red */
div.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
div.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
label.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
label.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
label.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
label.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
span.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
span.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
span.ResultsWithError { color: #C33; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
span.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
span.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
span.correct { color: inherit; background-color: #8F8; } /* green */
span.incorrect { color: #FF9494; background-color: inherit; } /* red */
Expand Down Expand Up @@ -683,7 +706,7 @@ span.gray_button{
}
#editor #form_div{
/*float: left;*/
float: left;
width: 100%;
}
Expand Down Expand Up @@ -729,10 +752,70 @@ span.gray_button{
margin-top: 10%;
margin-left: 10%;
margin-right: 10%;
}*/

#editor{
width: 585px;
}

#editor .pg_editor_input_span{
margin-bottom: 10px;
display: none;
}

#editor .pg_editor_input_div{
margin-top: 20px;
margin-left: 50px;
}

#editor #submit_input_div{
margin-top: 10px;
clear: both;
}

#pg_editor_header {
left: 790px;
position: absolute;
top: 130px;
}

#pg_editor_frame_id{
height: 474px;
left: 785px;
position: absolute;
top: 182px;
width: 50%;
overflow: scroll;
}

/*These are styles for the tables of problem sets*/
/*These are styles for the table of problem sets, found on the Homework Sets page. Most are simple alignment changes which makes it so everything isn't bunched up together.*/

.radio_span{
visibility: hidden;
}

table.problem_sets_table {
width: 640px;
float: left;
margin-bottom: 3%;
}

table.problem_sets_table caption {
}

table.problem_sets_table th{
width: 320px;
padding-bottom: 10px;
}

table.problem_sets_table td{
width: 320px;
}

div.problem_sets_options {
clear: both;
margin: 1% 1% 1% 1%;
}

/*This is the styling specifically for the tables of problems displayed for each problem set page*/
table.problem_set_table{
Expand Down
11 changes: 8 additions & 3 deletions conf/templates/math3/math3.css
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ span.gray_button{
width: 100%;
}
Styles specifically for the problem viewer
/*Styles specifically for the problem viewer*/

#problem_viewer_form{
margin-left: 10px;
Expand Down Expand Up @@ -790,7 +790,7 @@ Styles specifically for the problem viewer
left: 785px;
position: absolute;
top: 182px;
width: 500px;
width: 50%;
overflow: scroll;
}

Expand Down Expand Up @@ -829,7 +829,12 @@ table.problem_set_table{
#width: 640px;
text-align: left;
}

table.problem_set_table th{
padding-right: 30px;
}
table.problem_set_table td{
padding-right: 30px;
}
/*BUG FIXES*/

table#grades_table pre{
Expand Down
14 changes: 11 additions & 3 deletions lib/WeBWorK/ContentGenerator/Problem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ sub output_editorLink{
my $pg = $self->{pg};

my $r = $self->r;

my $ce = $r->ce;
my $authz = $r->authz;
my $urlpath = $r->urlpath;
my $user = $r->param('user');
Expand All @@ -1050,24 +1050,31 @@ sub output_editorLink{
# format as "[edit]" like we're doing with course info file, etc.
# add edit link for set as well.
my $editorLink = "";
my $editorLink2 = "";
# if we are here without a real homework set, carry that through
my $forced_field = [];
$forced_field = ['sourceFilePath' => $r->param("sourceFilePath")] if
($set->set_id eq 'Undefined_Set');
if ($authz->hasPermissions($user, "modify_problem_sets")) {
if ($authz->hasPermissions($user, "modify_problem_sets") and $ce->{showeditors}->{pgproblemeditor1}) {
my $editorPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", $r,
courseID => $courseName, setID => $set->set_id, problemID => $problem->problem_id);
my $editorURL = $self->systemLink($editorPage, params=>$forced_field);
$editorLink = CGI::p(CGI::a({href=>$editorURL,target =>'WW_Editor'}, $r->maketext("Edit this problem")));
}

if ($authz->hasPermissions($user, "modify_problem_sets") and $ce->{showeditors}->{pgproblemeditor2}) {
my $editorPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor2", $r,
courseID => $courseName, setID => $set->set_id, problemID => $problem->problem_id);
my $editorURL = $self->systemLink($editorPage, params=>$forced_field);
$editorLink2 = CGI::p(CGI::a({href=>$editorURL,target =>'WW_Editor2'}, $r->maketext("Edit this problem with new editor")));
}
##### translation errors? #####

if ($pg->{flags}->{error_flag}) {
if ($authz->hasPermissions($user, "view_problem_debugging_info")) {
print "Call errorOutput</br>";
print $self->errorOutput($pg->{errors}, $pg->{body_text});
print $editorLink;
print $editorLink2;
} else {
print $self->errorOutput($pg->{errors}, $r->maketext("You do not have permission to view the details of this error."));
}
Expand All @@ -1076,6 +1083,7 @@ sub output_editorLink{
}
else{
print $editorLink;
print $editorLink2;
}
return "";
}
Expand Down

0 comments on commit 92fcea5

Please sign in to comment.