[algospot-judge] r224 committed - problem authors can submit problems for review

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 11, 2010, 4:16:12 AM7/11/10
to algospo...@googlegroups.com
Revision: 224
Author: jongman
Date: Sat Jul 10 22:19:39 2010
Log: problem authors can submit problems for review
http://code.google.com/p/algospot-judge/source/detail?r=224

Modified:
/trunk/vanillaapp/controllers/class.problemscontroller.php
/trunk/vanillaapp/views/problems/edit.php

=======================================
--- /trunk/vanillaapp/controllers/class.problemscontroller.php Sat Jul 10
22:19:20 2010
+++ /trunk/vanillaapp/controllers/class.problemscontroller.php Sat Jul 10
22:19:39 2010
@@ -102,6 +102,11 @@
if(!$this->ProblemModel->IsIDUnique($Values["ID"],
$Values["No"])) {
$this->Form->AddError("ID is not unique.", "ID");
}
+ if($_POST["SubmitForReview"] == "on") {
+ $this->Form->SetFormValue("State",
ProblemState::PENDING_REVIEW);
+
+ }
+ print_r($_POST);
if($this->Form->Save()) {
$Values = $this->Form->FormValues();
Redirect("/problems/read/" . $Values["ID"]);
@@ -268,7 +273,7 @@
$PublishedOnly = !$this->IsAdmin();
if(isset($_GET["MineOnly"])) {
$this->ForceLogin();
- $Author = $this->Session->UserID;
+ $Author = $this->IsAdmin() ? FALSE : $this->Session->UserID;
$PublishedOnly = FALSE;
}
$Count = $this->ProblemModel->GetCount($params["SearchTerm"],
$Author, $PublishedOnly);
=======================================
--- /trunk/vanillaapp/views/problems/edit.php Sat Jul 10 22:19:10 2010
+++ /trunk/vanillaapp/views/problems/edit.php Sat Jul 10 22:19:39 2010
@@ -66,6 +66,11 @@
</table>
<a href="#" class="Button" id="UploadButton"><?=T("New
Attachment")?></a>
</div>
+ <? if(!$this->IsAdmin()) { ?>
+ <div>
+ <input name="SubmitForReview" type="checkbox"/> <?=T("Submit this
problem for review")?>: <?=T("Note you cannot edit the problem after
submitting.")?>
+ </div>
+ <? } ?>
<div>
<?=$this->Form->Button(T("Save"), array("class" => "Button")); ?>
</div>

Reply all
Reply to author
Forward
0 new messages