ผลต่างระหว่างรุ่นของ "418342 ภาคปลาย 2553/คะแนนและการส่งการบ้าน"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
แถว 97: แถว 97:
 
<td>ส่งแล้ว</td>
 
<td>ส่งแล้ว</td>
 
<td>ส่งแล้ว</td>
 
<td>ส่งแล้ว</td>
<td></td>
+
<td>ส่งแล้ว</td>
 
</tr>
 
</tr>
  

รุ่นแก้ไขเมื่อ 21:22, 21 มีนาคม 2554

การส่งงาน

รหัสประจำตัว การบ้าน 1 การบ้าน 2 การบ้าน 3
50040229 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50042993 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043058 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043082 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043140 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043173 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043215 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043231 ส่งแล้ว ส่งแล้ว ส่งแล้ว
50043306 ส่งแล้ว ส่งแล้ว ส่งแล้ว
51043214 ส่งแล้ว
50180249
51180198 ส่งแล้ว ส่งแล้ว ส่งแล้ว
51180503 ส่งแล้ว ส่งแล้ว ส่งแล้ว

คะแนนการบ้าน 1

รหัสประจำตัว A (30) B (10) C (10) D (20) E (10) F (10) G (10) รวม หมายเหตุ
50040229 30 10 10 10 10 0 0 70
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
  • -20 เนื่องจาก search ได้เพียง field Name เพียง field เดียว ที่เหลือ search ไม่ได้
50042993 30 10 2 10 0 0 0 52
  • -8 เนื่องจากมีเพียง 113 record
  • -30 เนื่องจาก search ไม่ได้เลย
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
50043058 30 10 10 10 0 0 0 60
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
  • -30 เนื่องจาก search ไม่ได้
50043082 30 10 10 20 10 10 10 100
50043140 30 10 10 10 10 10 10 90
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
50043173 30 10 10 20 10 0 0 80
  • -20 เนื่องจากไม่อนุญาตให้ผู้ใช้ search เงื่อนไขหลายๆ เงื่อนไขพร้อมๆ กัน
50043215 30 10 10 10 10 0 0 70
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
  • -20 เนื่องจากเวลา search เงื่อนไขหลายๆ อัน แล้วทำเหมือนกับ search ได้เพียงเงื่อนไขเดียวคือเงื่อนไขสุดท้ายเท่านั้น
50043231 30 8 2 10 10 10 10 80
  • -2 เนื่องจากมีเพียงแค่ 4 ฟีลด์
  • -8 เนื่องจากมีเพียงแค่ 137 record
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
50043306 30 10 10 10 10 10 10 90
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
51043214
50180249
51180198 30 10 10 10 10 10 10 90
  • -10 เนื่องจากแสดงข้อมูลทั้งหมด ไม่ลิมิตไว้ที่ 100 record
51180503

เกณฑ์การให้คะแนน

  • A: migration รันผ่าน (30)
  • B: จำนวนฟีลด์ (10)
  • C: จำนวน record (10)
  • D: หน้า search สามารถแสดงข้อมูลได้เมื่อไม่ใส่ข้อมูล search อะไรเลย (20)
  • E: Search ฟีลด์ 1 (10)
  • F: Search ฟีลด์ 2 (10)
  • G: Search ฟีลด์ 3 (10)

 คะแนนการบ้าน 3

คนที่ได้คะแนน

  • 50043058 ได้ 70 คะแนน
    • (-4) posts/show: wrong formatting
    • (-2) posts/show: wrong comment form redirect
    • (-4) posts/index: wrong formatting
    • (-2) posts/index: wrong comment link redirect
    • (-4) comments/index: wrong formatting
    • (-10) tag/show: doesn't follow instruction
  • 50043173 ได้ 78 คะแนน
    • (-4) posts/show: wrong formatting
    • (-4) posts/index: wrong formatting
    • (-2) posts/index: wrong comment link redirect
    • (-2) comments/index: wrong formatting
    • (-4) tag/show: AJAX doesn’t work
    • (-2) tag/show: wrong formatting
    • (-4) tag/show: display not correct
  • 51043214 ได้ 40 คะแนน
    • (-60) doesn't do other problem besides 1 and 2
  • 51180198 ได้ 70 คะแนน
    • (-4) posts/show: wrong formatting
    • (-2) posts/index: wrong formatting
    • (-2) posts/index: wrong comment link redirect
    • (-4) posts/admin: no unpublish
    • (-10) posts/edit: doesn't work
    • (-2) comments/index: wrong formatting
    • (-4) tag/show: AJAX doesn't work
    • (-2) tag/show: wrong formatting
  • 51180503 ได้ 78 คะแนน
    • (-2) posts/show: wrong formatting
    • (-2) posts/index: wrong comment link redirect
    • (-4) posts/edit: no tag input
    • (-6) posts/edit: all redirects are wrong
    • (-2) comments/index: wrong formatting
    • (-6) tags/show: cannot edit tag, so cannot show if it's correct

คนที่ไม่ได้คะแนนเนื่องจากลอกกัน

  • 50042993
  • 50040229
  • 50043082
  • 50043140
  • 50043215
  • 50043231
  • 50043360

ฟังก์ชัน update ใน app/controllers/posts_controller.rb (Pattern 1)

50042993 50043082 50043215 50043231 50043360

<geshi lang="ruby"> def update

   @post = Post.find(params[:id])

type = params['post']['buttonType'] params['post'].delete('buttonType') tags = params['post']['tags']

arrayTag = []

   tags.split(',').each do |tag|
     t = Tag.new
     t.name = Tag.normalize_name(tag)
     arrayTag << t
   end

params['post']['tags'] = arrayTag

   if type == '1'
     redirect_action = 'admin'
   elsif type == '2'
     redirect_action = 'edit'
   elsif type == '3'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end

</geshi>

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])
   buttontype = params['post']['buttontype']
   params['post'].delete('buttontype')
   
   tag_array = []
   
   params['post']['tags'].split(',').each do |t|
     tag = Tag.new
     tag.name = Tag.normalize_name(t)
     tag_array << tag
   end
   
   if buttontype == '1'
     redirect_action = 'admin'
   elsif buttontype == '2'
     redirect_action = 'edit'
   elsif buttontype == '3'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end
   
   params['post']['tags'] = tag_array

</geshi>

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])

type = params['post']['buttonType'] params['post'].delete('buttonType') tags = params['post']['tags']

arrayTag = []

   tags.split(',').each do |tag|
     t = Tag.new
     t.name = Tag.normalize_name(tag)
     arrayTag << t
   end

params['post']['tags'] = arrayTag

if type == '1'

     redirect_action = 'admin'
   elsif type == '2'
     redirect_action = 'edit'
   elsif type == '3'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end

</geshi>

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])
     type = params['post']['buttontype']
     params['post'].delete('buttontype')
     tag_array = []
     params['post']['tags'].split(',').each do |t|
       tag = Tag.new
       tag.name = Tag.normalize_name(t)
       tag_array << tag
     end
     if type == '1'
       redirect_action = 'admin'
     elsif type == '2'
       redirect_action = 'edit'
     elsif type == '3'
       params['post']['published_at'] = Time.now.getutc
       redirect_action = 'index'
     end
   params['post']['tags'] = tag_array

</geshi>

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])
   buttontype = params['post']['buttontype']
   params['post'].delete('buttontype')
   
   tag_array = []
   
   params['post']['tags'].split(',').each do |t|
     tag = Tag.new
     tag.name = Tag.normalize_name(t)
     tag_array << tag
   end
   
   if buttontype == '1'
     redirect_action = 'admin'
   elsif buttontype == '2'
     redirect_action = 'edit'
   elsif buttontype == '3'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end
   
   params['post']['tags'] = tag_array

</geshi>

ฟังก์ชัน update ใน app/controllers/posts_controller.rb (Pattern 2)

50040229 50043140

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])
   buttontype = params['post']['buttontype']
   params['post'].delete('buttontype')
   
   tag_array = []
   
    
   for t in params['post']['tags'].split(',')
   
   tag = Tag.new
   tag.name = Tag.normalize_name(t)
   tag_array << tag
   
   end    
   
   if buttontype == '2'
     redirect_action = 'edit'
   elsif buttontype == '3'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end
   
   params['post']['tags'] = tag_array
   
   respond_to do |format|
     if @post.update_attributes(params[:post])
       flash[:notice] = 'Post was successfully updated.'
       
       
       if buttontype == '1'
       format.html { redirect_to :action=> "admin",:id => 0 }
       else
       format.html { redirect_to :action=> redirect_action }
       end
       
       format.xml  { head :ok }
     else
       format.html { render :action => "edit" }
       format.xml  { render :xml => @post.errors, :status => :unprocessable_entity }
     end
   end
 end

</geshi>

<geshi lang="ruby">

 def update
   @post = Post.find(params[:id])
   submitmode = params['post']['submitmode']
   params['post'].delete('submitmode')
   
   tag_array = []
   
    
   for t in params['post']['tags'].split(',')
   
   tag = Tag.new
   tag.name = Tag.normalize_name(t)
   tag_array << tag
   
   end
   
     
   
   if submitmode == 'sc'
     redirect_action = 'edit'
   elsif submitmode == 'p'
     params['post']['published_at'] = Time.now.getutc
     redirect_action = 'index'
   end
   
   params['post']['tags'] = tag_array
   
   respond_to do |format|
     if @post.update_attributes(params[:post])
       flash[:notice] = 'Post was successfully updated.'
       
       
       if submitmode == 's'
       format.html { redirect_to :action=> "admin",:id => 0 }
       else
       format.html { redirect_to :action=> redirect_action }
       end
       
       format.xml  { head :ok }
     else
       format.html { render :action => "edit" }
       format.xml  { render :xml => @post.errors, :status => :unprocessable_entity }
     end
   end
 end

</geshi>