-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icons in LB1 to signal problems with math objects and static problems #530
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b80da8a
Support for new tags in OPL-update: does the problem use math objects…
jwj61 43779d2
Add support for new OPL tags to the tagging module.
jwj61 7acd928
Add icon for MathObject problems in library browser
jwj61 6c49b4a
New feature: in LB1 problems display an icon if they are tagged as
jwj61 887761b
Make it so that clicking on the MathObject icons in LB1 problem displ…
jwj61 e62ad7b
Correct wording in help file.
jwj61 c67bdda
Fix bug with MO icons where they jump to the wrong side of the
jwj61 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<html> | ||
<!-- | ||
################################################################################ | ||
# WeBWorK Online Homework Delivery System | ||
# Copyright � 2000-2014 The WeBWorK Project, http://openwebwork.sf.net/ | ||
# This program is free software; you can redistribute it and/or modify it under | ||
# the terms of either: (a) the GNU General Public License as published by the | ||
# Free Software Foundation; either version 2, or (at your option) any later | ||
# version, or (b) the "Artistic License" which comes with this package. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the | ||
# Artistic License for more details. | ||
################################################################################ | ||
--> | ||
<head> | ||
<title>Uses Math Objects</title> | ||
</head> | ||
|
||
<body><br> | ||
<p> | ||
Some WeBWorK are programmed using what are called <i>Math Objects</i>. | ||
These problems are preferred by some people because they | ||
provide a more consistent collection of messages to faulty student | ||
answers, particularly for answers which are way off base. | ||
</p> | ||
|
||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ use strict; | |
use DBI; | ||
use WeBWorK::Utils qw(sortByName); | ||
use WeBWorK::Utils::Tags; | ||
use File::Basename; | ||
|
||
use constant LIBRARY_STRUCTURE => { | ||
textbook => { select => 'tbk.textbook_id,tbk.title,tbk.author,tbk.edition', | ||
|
@@ -42,7 +43,7 @@ BEGIN | |
&createListing &updateListing &deleteListing &getAllChapters | ||
&getAllSections &searchListings &getAllListings &getSectionListings | ||
&getAllDBsubjects &getAllDBchapters &getAllDBsections &getDBTextbooks | ||
&getDBListings &countDBListings &getTables | ||
&getDBListings &countDBListings &getTables &getDBextras | ||
); | ||
%EXPORT_TAGS =(); | ||
@EXPORT_OK =qw(); | ||
|
@@ -122,7 +123,7 @@ sub getProblemTags { | |
my $path = shift; | ||
my $tags = WeBWorK::Utils::Tags->new($path); | ||
my %thash = (); | ||
for my $j ('DBchapter', 'DBsection', 'DBsubject', 'Level') { | ||
for my $j ('DBchapter', 'DBsection', 'DBsubject', 'Level', 'Status') { | ||
$thash{$j} = $tags->{$j}; | ||
} | ||
return \%thash; | ||
|
@@ -135,11 +136,13 @@ sub setProblemTags { | |
my $chap = shift; | ||
my $sect = shift; | ||
my $level = shift; | ||
my $status = shift || 0; | ||
my $tags = WeBWorK::Utils::Tags->new($path); | ||
$tags->settag('DBsubject', $subj, 1); | ||
$tags->settag('DBchapter', $chap, 1); | ||
$tags->settag('DBsection', $sect, 1); | ||
$tags->settag('Level', $level, 1); | ||
$tags->settag('Status', $status, 0) if $status; | ||
eval { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity what is the status tag? |
||
$tags->write(); | ||
1; | ||
|
@@ -182,6 +185,37 @@ sub makeKeywordWhere { | |
return "AND ( $where )"; | ||
} | ||
|
||
=item getDBextras($path) | ||
Get flags for whether a pg file uses Math Objects, and if it is static | ||
|
||
$r is a Apache request object so we can get the right table names | ||
|
||
$path is the path to the file | ||
|
||
Out put is an array reference: [MO, static] | ||
|
||
=cut | ||
|
||
sub getDBextras { | ||
my $r = shift; | ||
my $path = shift; | ||
my %tables = getTables($r->ce); | ||
my $dbh = getDB($r->ce); | ||
my ($mo, $static)=(0,0); | ||
|
||
$path =~ s|^Library/||; | ||
my $filename = basename $path; | ||
$path = dirname $path; | ||
my $query = "SELECT pgfile.MO, pgfile.static FROM `$tables{pgfile}` pgfile, `$tables{path}` p WHERE p.path=\"$path\" AND pgfile.path_id=p.path_id AND pgfile.filename=\"$filename\""; | ||
my @res = $dbh->selectrow_array($query); | ||
if(@res) { | ||
$mo = $res[0]; | ||
$static = $res[1]; | ||
} | ||
|
||
return [$mo, $static]; | ||
} | ||
|
||
=item getDBTextbooks($r) | ||
Returns textbook dependent entries. | ||
|
||
|
@@ -440,10 +474,10 @@ sub getDBListings { | |
} | ||
my @results=(); | ||
for my $pgid (@pg_ids) { | ||
$query = "SELECT path, filename, morelt_id, pgfile_id FROM `$tables{pgfile}` pgf, `$tables{path}` p | ||
$query = "SELECT path, filename, morelt_id, pgfile_id, static, MO FROM `$tables{pgfile}` pgf, `$tables{path}` p | ||
WHERE p.path_id = pgf.path_id AND pgf.pgfile_id=\"$pgid\""; | ||
my $row = $dbh->selectrow_arrayref($query); | ||
push @results, {'path' => $row->[0], 'filename' => $row->[1], 'morelt' => $row->[2], 'pgid'=> $row->[3] }; | ||
push @results, {'path' => $row->[0], 'filename' => $row->[1], 'morelt' => $row->[2], 'pgid'=> $row->[3], 'static' => $row->[4], 'MO' => $row->[5] }; | ||
|
||
} | ||
return @results; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "Some WeBWorK problems"